I am facing the issue when i move the code to server.It is working fine in my local system.
when i searched about the issue i found i have to use capital letters in config file.
I have updated the config file to caps but still the issue exist.
Please suggest.
Config.xml
<?xml version="1.0"?>
<config>
<modules>
<Mdl_Ajaxcheckout>
<version>0.1.0</version>
<depends>
<Mage_Customer />
<Mage_Checkout />
</depends>
</Mdl_Ajaxcheckout>
</modules>
<global>
<models>
<mdlajaxcheckout>
<class>Mdl_Ajaxcheckout_Model</class>
</mdlajaxcheckout>
</models>
<events>
<checkout_cart_product_add_after>
<observers>
<mdl_ajaxcheckout_model_observer>
<class>Mdl_Ajaxcheckout_Model_Observer</class>
<method>modifyPrice</method>
</mdl_ajaxcheckout_model_observer>
</observers>
</checkout_cart_product_add_after>
</events>
<blocks>
<mdlajaxcheckout>
<class>Mdl_Ajaxcheckout_Block</class>
</mdlajaxcheckout>
</blocks>
<helpers>
<mdlajaxcheckout>
<class>Mdl_Ajaxcheckout_Helper</class>
</mdlajaxcheckout>
</helpers>
</global>
<frontend>
<layout>
<updates>
<mdlajaxcheckout>
<file>mdlajaxcheckout.xml</file>
</mdlajaxcheckout>
</updates>
</layout>
<translate>
<modules>
<Mdl_Ajaxcheckout>
<files>
<default>mdl_ajaxcheckout.csv</default>
</files>
</Mdl_Ajaxcheckout>
</modules>
</translate>
</frontend>
<frontend>
<routers>
<mdlajaxcheckout>
<use>standard</use>
<args>
<module>Mdl_Ajaxcheckout</module>
<frontName>mdlajaxcheckout</frontName>
</args>
</mdlajaxcheckout>
</routers>
</frontend>
<adminhtml>
<acl>
<resources>
<admin>
<children>
<catalog>
<children>
<mdlajaxcheckout_adminform>
<title>Configuration</title>
</mdlajaxcheckout_adminform>
</children>
</catalog>
</children>
</admin>
</resources>
</acl>
<acl>
<resources>
<admin>
<children>
<system>
<children>
<config>
<children>
<mdlajaxcheckout>
<title>Mdl Ajax Cart</title>
</mdlajaxcheckout>
</children>
</config>
</children>
</system>
<customer>
<children>
<mdlajaxcheckout translate="title">
<title>Mdl Ajax Cart</title>
<sort_order>45</sort_order>
</mdlajaxcheckout>
</children>
</customer>
</children>
</admin>
</resources>
</acl>
</adminhtml>
<default>
<mdlajaxcheckout>
<default>
<mdl_ajax_cart_loading_size>260x50</mdl_ajax_cart_loading_size>
<mdl_ajax_cart_confirm_size>320x134</mdl_ajax_cart_confirm_size>
<mdl_ajax_cart_image_size>55x55</mdl_ajax_cart_image_size>
<mdl_ajax_cart_show_popup>1</mdl_ajax_cart_show_popup>
</default>
</mdlajaxcheckout>
</default>
<global>
</global>
</config>
Observer.php
<?php
class Mdl_Ajaxcheckout_Model_Observer
{
public function modifyPrice(Varien_Event_Observer $obs)
{
// Get the quote item
$item = $obs->getQuoteItem();
// Ensure we have the parent item, if it has one
$item = ( $item->getParentItem() ? $item->getParentItem() : $item );
//$demo=new Mdl_Ajaxcheckout_IndexController();
// Load the custom price
$price ="20";
// Set the custom price
$item->setCustomPrice($price);
$item->setOriginalCustomPrice($price);
// Enable super mode on the product.
$item->getProduct()->setIsSuperMode(true);
Mage::getSingleton('core/session')->setWelcomeMessage();
}
}
?>
code for enabling the module.
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<Mdl_Ajaxcheckout>
<!-- Whether our module is active: true or false -->
<active>true</active>
<!-- Which code pool to use: core, community or local -->
<codePool>community</codePool>
</Mdl_Ajaxcheckout>
</modules>
</config>
Finally I got the solution for above thread.
We need to disable the compiler status in admin.
system->tools->compilation->click disable.
Now your observer event will work.
Related
The below are the config xml wrt infinispan and jgroups. ${cache.clusterName}" is substituted at runtime with C1 [the configured cluster name] in
Infinispan_config.xml. The C2 is not the one configured to be a cluster [though present as a clustername, there is no code that I could figureout from the code base that replace c1 as C2].
background we are running jboss 7 in parallel with jboss5 as part of migration but for the jboss5 to be in sync with jboss 7 seems it needs to be the same cluster
1) Please point any other repercussion of this warning apart from the additional set of logs. App was unstable post running in parallel in prod. The same build worked fine in lower env
<?xml version="1.0" encoding="UTF-8"?>
<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:infinispan:config:4.2 http://www.infinispan.org/schemas/infinispan-config-4.2.xsd"
xmlns="urn:infinispan:config:4.2">
<global>
<transport clusterName="${cache.clusterName}">
<properties>
<property name="configurationFile" value="jgroups-tcp.xml" />
</properties>
</transport>
</global>
<default>
<locking isolationLevel="READ_COMMITTED"
lockAcquisitionTimeout="10000" writeSkewCheck="false"
concurrencyLevel="50" useLockStriping="false" />
<clustering mode="replication">
<stateRetrieval initialRetryWaitTime="1000" timeout="10000" numRetries="10"
alwaysProvideInMemoryState="true" fetchInMemoryState="true" />
<sync />
</clustering>
</default>
jgroups.xml
<config xmlns="urn:org:jgroups"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:org:jgroups file:schema/JGroups-2.8.xsd">
<TCP
bind_addr="${jboss.bind.address}"
bind_port="${jgroups.tcp.port:7800}"
loopback="true"
port_range="30"
recv_buf_size="20000000"
send_buf_size="640000"
discard_incompatible_packets="true"
max_bundle_size="64000"
max_bundle_timeout="30"
enable_bundling="true"
use_send_queues="true"
sock_conn_timeout="300"
enable_diagnostics="false"
thread_pool.enabled="true"
thread_pool.min_threads="2"
thread_pool.max_threads="30"
thread_pool.keep_alive_time="5000"
thread_pool.queue_enabled="false"
thread_pool.queue_max_size="100"
thread_pool.rejection_policy="Discard"
oob_thread_pool.enabled="true"
oob_thread_pool.min_threads="2"
oob_thread_pool.max_threads="30"
oob_thread_pool.keep_alive_time="5000"
oob_thread_pool.queue_enabled="false"
oob_thread_pool.queue_max_size="100"
oob_thread_pool.rejection_policy="Discard"
/>
<!-- Ergonomics, new in JGroups 2.11, are disabled by default in TCPPING until JGRP-1253 is resolved -->
<TCPPING timeout="10000"
initial_hosts="${jgroups.initial.hosts}"
port_range="0"
num_initial_members="${jgroups.num.initial.members:4}"
ergonomics="false"
/>
<MERGE2 max_interval="30000" min_interval="10000"/>
<FD_SOCK/>
<FD timeout="3000" max_tries="3"/>
<VERIFY_SUSPECT timeout="1500"/>
<pbcast.NAKACK
use_mcast_xmit="false" gc_lag="0"
retransmit_timeout="300,600,1200,2400,4800"
discard_delivered_msgs="false"/>
<UNICAST timeout="300,600,1200"/>
<pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000" max_bytes="400000"/>
<pbcast.GMS print_local_addr="false" join_timeout="7000" view_bundling="true"/>
<UFC max_credits="2000000" min_threshold="0.10"/>
<MFC max_credits="2000000" min_threshold="0.10"/>
<FRAG2 frag_size="60000"/>
<pbcast.STREAMING_STATE_TRANSFER/>
<pbcast.FLUSH timeout="0"/>
</config>
I'm trying to deploy an ASP.net 5 website to my local service fabric dev cluster but get an Access Denied exception on every deploy. I know that the problem is with the web service because when I remove it from the deployment my other service is deployed without any error
This exception looks like it is trying to delete a file, but which one and why wouldn't it have access?
6>. 'E:\Github\Flow.Server\Flow.Server.Fabric\Scripts\Deploy-FabricApplication.ps1' -ApplicationPackagePath 'E:\Github\Flow.Server\Flow.Server.Fabric\pkg\Debug' -PublishProfileFile 'E:\Github\Flow.Server\Flow.Server.Fabric\PublishProfiles\Local.xml' -DeployOnly:$true -UnregisterUnusedApplicationVersionsAfterUpgrade $false -OverrideUpgradeBehavior 'None' -OverwriteBehavior 'Always' -ErrorAction Stop
6>Message : Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
6>Data : {}
6>InnerException :
6>TargetSite : Void RunInMTA(System.Action)
6>StackTrace : at System.Fabric.Interop.Utility.RunInMTA(Action action)
6> at System.Fabric.Common.FabricDirectory.Delete(String path, Boolean recursive, Boolean
6> deleteReadOnlyFiles)
6> at Microsoft.ServiceFabric.Powershell.ApplicationCmdletBase.TestApplicationPackage(String
6> applicationPackagePath, Hashtable applicationParameters, String imageStoreConnectionString)
6> at System.Management.Automation.CommandProcessor.ProcessRecord()
6>HelpLink :
6>Source : System.Fabric
6>HResult : -2147024891
Here is my ApplicationManifest
<?xml version="1.0" encoding="utf-8"?>
<ApplicationManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ApplicationTypeName="Flow.Server.FabricType" ApplicationTypeVersion="1.0.0" xmlns="http://schemas.microsoft.com/2011/01/fabric">
<Parameters>
<Parameter Name="Silo_InstanceCount" DefaultValue="-1" />
</Parameters>
<ServiceManifestImport>
<ServiceManifestRef ServiceManifestName="Flow.Server.Fabric.WebApi" ServiceManifestVersion="1.0.0" />
</ServiceManifestImport>
<ServiceManifestImport>
<ServiceManifestRef ServiceManifestName="Flow.Server.Fabric.SiloPkg" ServiceManifestVersion="1.0.0" />
<ConfigOverrides />
</ServiceManifestImport>
<DefaultServices>
<Service Name="Flow.Server.Fabric.WebApiService">
<StatelessService ServiceTypeName="Flow.Server.Fabric.WebApiType">
<SingletonPartition />
</StatelessService>
</Service>
<Service Name="Flow.Server.Fabric.Silo">
<StatelessService ServiceTypeName="Flow.Server.Fabric.SiloType" InstanceCount="[Silo_InstanceCount]">
<SingletonPartition />
</StatelessService>
</Service>
</DefaultServices>
</ApplicationManifest>
And here is the ServiceManifest
<?xml version="1.0" encoding="utf-8"?>
<ServiceManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Name="Flow.Server.Fabric.WebApi" Version="1.0.0" xmlns="http://schemas.microsoft.com/2011/01/fabric">
<ServiceTypes>
<StatelessServiceType ServiceTypeName="Flow.Server.Fabric.WebApiType">
<Extensions>
<Extension Name="__GeneratedServiceType__">
<GeneratedNames xmlns="http://schemas.microsoft.com/2015/03/fabact-no-schema">
<DefaultService Name="Flow.Server.Fabric.WebApiService" />
<ServiceEndpoint Name="Flow.Server.Fabric.WebApiTypeEndpoint" />
</GeneratedNames>
</Extension>
</Extensions>
</StatelessServiceType>
</ServiceTypes>
<CodePackage Name="C" Version="1.0.0">
<EntryPoint>
<ExeHost>
<Program>approot\runtimes\dnx-clr-win-x64.1.0.0-rc1-update1\bin\dnx.exe</Program>
<Arguments>--appbase approot\src\Flow.Server.Fabric.WebApi Microsoft.Dnx.ApplicationHost Microsoft.ServiceFabric.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener</Arguments>
<WorkingFolder>CodePackage</WorkingFolder>
<ConsoleRedirection FileRetentionCount="5" FileMaxSizeInKb="2048" />
</ExeHost>
</EntryPoint>
</CodePackage>
<Resources>
<Endpoints>
<Endpoint Name="Flow.Server.Fabric.WebApiTypeEndpoint" Protocol="http" Type="Input" />
</Endpoints>
</Resources>
</ServiceManifest>
This is my xml file on Magento
<config>
<api2>
<resource_groups>
<extendrestapi translate="title" module="api2">
<title>Extended Rest API</title>
<sort_order>10</sort_order>
</extendrestapi>
</resource_groups>
<resources>
<extendrestapicategory translate="title" module="api2">
<group>extendrestapi</group>
<model>extendrestapi/api2_category</model>
<title>Categories</title>
<sort_order>10</sort_order>
<privileges>
<admin>
<retrieve>1</retrieve>
</admin>
<guest>
<retrieve>1</retrieve>
</guest>
</privileges>
<attributes>
<entity_id>Category ID</entity_id>
<name>Name</name>
<parent_id>Category Parent ID</parent_id>
<is_active>Active</is_active>
<level>Level</level>
<position>Position</position>
<children>Children Ids</children>
<url_key>URL key</url_key>
<store_id>Store ID</store_id>
</attributes>
<routes>
<route_entity>
<route>/ikom/categories/:id</route>
<action_type>collection</action_type>
</route_entity>
<route_collection>
<route>/ikom/categories</route>
<action_type>collection</action_type>
</route_collection>
</routes>
<versions>1</versions>
</extendrestapicategory>
<extendrestapiproductattribute translate="title" module="api2">
<group>extendrestapi</group>
<model>extendrestapi/api2_productattribute</model>
<title>Product Attributes</title>
<sort_order>10</sort_order>
<privileges>
<admin>
<retrieve>1</retrieve>
</admin>
<guest>
<retrieve>1</retrieve>
</guest>
</privileges>
<attributes>
<id>Name</id>
<options>Options value/label</options>
</attributes>
<routes>
<route_entity>
<route>/testapi/:id</route>
<action_type>collection</action_type>
</route_entity>
<route_collection>
<route>/testapi</route>
<action_type>collection</action_type>
</route_collection>
</routes>
<versions>1</versions>
</extendrestapiproductattribute>
</resources>
</api2>
</config>
I do not know why I run this url http://localhost/magento_4/api/rest/ikom/testapi/1, this have response {"messages":{"error":[{"code":404,"message":"Request does not match any route."}]}}.
What wrong here ?
The configuration is not yet ready, let's see this http://www.authenticdesign.co.uk/extending-magento-rest-api-v2/#part1
I have different .xsd files and I want to generate java classes from them in different packages. I configure maven maven-jaxb2-plugin as following
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.11.0</version>
<executions>
<execution>
<id>generate-messages</id>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<forceRegenerate>true</forceRegenerate>
<generateDirectory>${basedir}/src/main/java</generateDirectory>
<schemas>
<schema>
<fileset>
<directory>${basedir}/src/main/resources/bindings</directory>
<includes>
<include>lmsApiBinding.xml</include>
</includes>
</fileset>
</schema>
</schemas>
</configuration>
</plugin>
Here is my file
<jaxb:bindings xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:annox="http://annox.dev.java.net"
xsi:schemaLocation="http://java.sun.com/xml/ns/jaxb
http://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd"
version="2.1">
<jaxb:globalBindings generateElementProperty="false">
<xjc:serializable uid="1" />
</jaxb:globalBindings>
<jaxb:bindings schemaLocation="/src/main/webapp/schemas/lmsapi/serviceoperations/CustomerServiceOperations.xsd" node="/xsd:schema">
<jaxb:schemaBindings>
<jaxb:package name="abc.customer" />
</jaxb:schemaBindings>
</jaxb:bindings>
<jaxb:bindings schemaLocation="/src/main/webapp/schemas/lmsapi/serviceoperations/EnrollmentServiceOperations.xsd" node="/xsd:schema">
<jaxb:schemaBindings>
<jaxb:package name="def.enrollment" />
</jaxb:schemaBindings>
</jaxb:bindings>
....
</jaxb:bindings>
Here is my CustomerServiceOperations.xsd file
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://customer.serviceoperations.lmsapi.message.webservice.lms.vu360.softech.com"
xmlns="http://customer.serviceoperations.lmsapi.message.webservice.lms.vu360.softech.com"
xmlns:cust="http://customer.types.lmsapi.message.webservice.lms.vu360.softech.com"
xmlns:tr="http://transactionresult.types.lmsapi.message.webservice.lms.vu360.softech.com"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xsd:import namespace="http://transactionresult.types.lmsapi.message.webservice.lms.vu360.softech.com" schemaLocation="../types/TransactionResultType.xsd"/>
<xsd:import namespace="http://customer.types.lmsapi.message.webservice.lms.vu360.softech.com" schemaLocation="../types/Customer.xsd"/>
<xsd:element name="AddCustomerRequest">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Customers" type="cust:Customers" minOccurs="1" maxOccurs="1" nillable="false" />
</xsd:sequence>
<xsd:attribute name="key" type="xsd:string" use="required" />
<xsd:attribute name="ResellerId" type="xsd:nonNegativeInteger" use="required" />
</xsd:complexType>
</xsd:element>
<xsd:element name="AddCustomerResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="RegisterCustomers" type="cust:RegisterCustomers" minOccurs="0" maxOccurs="1" nillable="false" />
</xsd:sequence>
<xsd:attribute name="transactionResult" type="tr:TransactionResultType" use="required"/>
<xsd:attribute name="transactionResultMessage" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
</xsd:schema>
But when I click on my .pom file and select Run As --> maven Generate Sources Then I get the following errors
org.xml.sax.SAXParseException; systemId: file:/D:/Basit/eclipse-jee-luna/workspace/lms-api-1/src/main/resources/bindings/lmsApiBinding.xml; lineNumber: 10; columnNumber: 19; s4s-elt-schema-ns: The namespace of element 'bindings' must be from the schema namespace, 'http://www.w3.org/2001/XMLSchema'.
...
org.xml.sax.SAXParseException; systemId: file:/D:/Basit/eclipse-jee-luna/workspace/lms-api-1/src/main/resources/bindings/lmsApiBinding.xml; lineNumber: 10; columnNumber: 19; s4s-elt-invalid: Element 'bindings' is not a valid element in a schema document.
...
org.xml.sax.SAXParseException; systemId: file:/D:/Basit/eclipse-jee-luna/workspace/lms-api-1/src/main/resources/bindings/lmsApiBinding.xml; lineNumber: 10; columnNumber: 19; schema_reference.4: Failed to read schema document 'file:/D:/Basit/eclipse-jee-luna/workspace/lms-api-1/src/main/resources/bindings/lmsApiBinding.xml', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
Why I am getting these errors ? What I am doing wrong?
Thanks
------Edit----
<schemas>
<schema>
<fileset>
<directory>${basedir}/src/main/webapp/schemas/lmsapi</directory>
<includes>
<include>/serviceoperations/CustomerServiceOperations.xsd</include>
<include>/serviceoperations/EnrollmentServiceOperations.xsd</include>
<include>/serviceoperations/OrgGroupServiceOperations.xsd</include>
...
<include>/types/Address.xsd</include>
<include>/types/Course.xsd</include>
<include>/types/Customer.xsd</include>
....
<include>/types/UserGroup.xsd</include>
<include>/types/Vu360User.xsd</include>
</includes>
</fileset>
</schema>
</schemas>
--Final working code--
Hi,
Thanks. Finally got it working. Here is my file LmsApiServiceOperations.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://com/softech/vu360/lms/webservice/message/lmsapi/serviceoperations"
xmlns="http://com/softech/vu360/lms/webservice/message/lmsapi/serviceoperations"
elementFormDefault="qualified">
<xsd:import namespace="http://trainingplan.serviceoperations.lmsapi.message.webservice.lms.vu360.softech.com" schemaLocation="TrainingPlanServiceOperations.xsd"/>
<xsd:import namespace="http://customer.serviceoperations.lmsapi.message.webservice.lms.vu360.softech.com" schemaLocation="CustomerServiceOperations.xsd"/>
<xsd:import namespace="http://user.serviceoperations.lmsapi.message.webservice.lms.vu360.softech.com" schemaLocation="UserServiceOperations.xsd"/>
<xsd:import namespace="http://enrollment.serviceoperations.lmsapi.message.webservice.lms.vu360.softech.com" schemaLocation="EnrollmentServiceOperations.xsd"/>
<xsd:import namespace="http://securityroles.serviceoperations.lmsapi.message.webservice.lms.vu360.softech.com" schemaLocation="SecurityRoleServiceOperations.xsd"/>
<xsd:import namespace="http://orggroup.serviceoperations.lmsapi.message.webservice.lms.vu360.softech.com" schemaLocation="OrgGroupServiceOperations.xsd"/>
<xsd:import namespace="http://usergroup.serviceoperations.lmsapi.message.webservice.lms.vu360.softech.com" schemaLocation="UserGroupServiceOperations.xsd"/>
</xsd:schema>
Here is the plugin configuration
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.11.0</version>
<executions>
<execution>
<id>generate-messages</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<bindingDirectory>${basedir}/src/main/resources/bindings</bindingDirectory>
<bindingIncludes>
<bindingInclude>lmsApiBinding.xml</bindingInclude>
</bindingIncludes>
<generateDirectory>${basedir}/src/main/java/</generateDirectory>
<schemas>
<schema>
<fileset>
<directory>${basedir}/src/main/webapp/schemas/lmsapi/</directory>
<includes>
<include>serviceoperations/LmsApiServiceOperations.xsd</include>
</includes>
</fileset>
</schema>
</schemas>
<strict>true</strict>
<extension>true</extension>
<verbose>true</verbose>
<forceRegenerate>true</forceRegenerate>
</configuration>
</execution>
</executions>
</plugin>
Also my lmsApiBinding.xml file only contain now
<jaxb:bindings xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:annox="http://annox.dev.java.net"
xsi:schemaLocation="http://java.sun.com/xml/ns/jaxb
http://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd"
version="2.1">
<jaxb:globalBindings generateElementProperty="false">
<xjc:serializable uid="1" />
</jaxb:globalBindings>
</jaxb:bindings>
Because if i use something like
<jaxb:globalBindings generateElementProperty="false">
<xjc:serializable uid="1" />
</jaxb:globalBindings>
<jaxb:bindings schemaLocation="CustomerServiceOperations.xsd" node="/xsd:schema">
<jaxb:schemaBindings>
<jaxb:package name="com.softech.vu360.lms.webservice.message.lmsapi.serviceoperations.customer" />
</jaxb:schemaBindings>
</jaxb:bindings>
<jaxb:bindings schemaLocation="/schemas/lmsapi/serviceoperations/EnrollmentServiceOperations.xsd" node="/xsd:schema">
<jaxb:schemaBindings>
<jaxb:package name="com.softech.vu360.lms.webservice.message.lmsapi.serviceoperations.enrollment" />
</jaxb:schemaBindings>
</jaxb:bindings>
Then select Maven --> Generate sources. Then I get the following error
com.sun.istack.SAXParseException2; systemId: file:/D:/Basit/eclipse-jee-luna/workspace/360Training/lms-api-1/src/main/resources/bindings/lmsApiBinding.xml; lineNumber: 17; columnNumber: 86; "file:/D:/Basit/eclipse-jee-luna/workspace/360Training/lms-api-1/src/main/resources/bindings/CustomerServiceOperations.xsd" is not a part of this compilation. Is this a mistake for "file:/D:/Basit/eclipse-jee-luna/workspace/360Training/lms-api-1/src/main/resources/bindings/lmsApiBinding.xml"?
I was using binding file because I want to generate classes in different packages. But it seems it generate package name from targetnamespace. As I declared in my CustomerServiceOperations.xsd file
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://customer.serviceoperations.lmsapi.message.webservice.lms.vu360.softech.com"
xmlns="http://customer.serviceoperations.lmsapi.message.webservice.lms.vu360.softech.com"
xmlns:cust="http://customer.types.lmsapi.message.webservice.lms.vu360.softech.com"
xmlns:tr="http://transactionresult.types.lmsapi.message.webservice.lms.vu360.softech.com"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
....
</xsd:schema>
So after generating sources. It automatically put my CustomerServiceOperations.xsd operations in package com.softech.vu360.lms.webservice.message.lmsapi.serviceoperations.customer
Thanks
You put lmsApiBinding.xml(bindings file) instead of your XSD CustomerServiceOperations.xsd... I use this configuration in my project and works fine.
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.11.0</version>
<executions>
<execution>
<id>generate-messages</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<bindingDirectory>${basedir}/src/main/resources/bindings</bindingDirectory>
<bindingIncludes>
<bindingInclude>lmsApiBinding.xml</bindingInclude>
</bindingIncludes>
<generateDirectory>${basedir}/src/main/java/</generateDirectory>
<schemas>
<schema>
<fileset>
<directory>${basedir}/src/main/resources/schema/xsd</directory>
<includes>
<include>CustomerServiceOperations.xsd</include>
</includes>
</fileset>
</schema>
</schemas>
<strict>true</strict>
<extension>true</extension>
<verbose>true</verbose>
<forceRegenerate>true</forceRegenerate>
</configuration>
</execution>
</executions>
</plugin>
I'm working with a 10-node Infinispan cluster used as a Hibernate Search backend. Our servers are running TC server 2.5 (tomcat 6.0.32) on Java 1.6_24. We are using jGroups 2.12.1.3 for handling cluster cache writes from each node, and for multicast UDP transport.
When we launch 3+ nodes in our cluster, eventually one of the nodes begins to log replication timeouts. We've observed the same result whether we configure Infinispan for replication or for distribution cache modes. Although the rest of the cluster remains stable, the failing node becomes essentially unsuable for search.
Our configuration:
Infinispan:
<?xml version="1.0" encoding="UTF-8"?>
<infinispan
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:infinispan:config:5.0 http://www.infinispan.org/schemas/infinispan-config-5.0.xsd"
xmlns="urn:infinispan:config:5.0">
<global>
<globalJmxStatistics
enabled="true"
cacheManagerName="HibernateSearch"
allowDuplicateDomains="true" />
<transport
clusterName="HibernateSearch-Infinispan-cluster-MT"
distributedSyncTimeout="50000">
<properties>
<property name="configurationFile" value="infinispan-udp.cfg.xml" />
</properties>
</transport>
<shutdown
hookBehavior="DONT_REGISTER" />
</global>
<default>
<locking
lockAcquisitionTimeout="20000"
writeSkewCheck="false"
concurrencyLevel="5000"
useLockStriping="false" />
<storeAsBinary storeKeysAsBinary="false" storeValuesAsBinary="true"
enabled="false" />
<invocationBatching
enabled="true" />
<clustering
mode="replication">
<stateRetrieval
timeout="60000"
logFlushTimeout="65000"
fetchInMemoryState="true"
alwaysProvideInMemoryState="true" />
<sync
replTimeout="50000" />
<l1 enabled="false" />
</clustering>
<jmxStatistics
enabled="true" />
<eviction
maxEntries="-1"
strategy="NONE" />
<expiration
maxIdle="-1" />
</default>
<namedCache
name="LuceneIndexesMetadata">
<clustering
mode="replication">
<stateRetrieval
fetchInMemoryState="true"
logFlushTimeout="30000" />
<sync
replTimeout="50000" />
<l1 enabled="false" />
</clustering>
<locking
lockAcquisitionTimeout="20000"
writeSkewCheck="false"
concurrencyLevel="5000"
useLockStriping="false" />
<loaders shared="true" preload="true">
<loader class="org.infinispan.loaders.jdbm.JdbmCacheStore" fetchPersistentState="false" ignoreModifications="false" purgeOnStartup="false">
<properties>
<property name="location" value="/usr/local/tc/.index/metadata" />
</properties>
</loader>
</loaders>
</namedCache>
<namedCache
name="LuceneIndexesData">
<clustering
mode="replication">
<stateRetrieval
fetchInMemoryState="true"
logFlushTimeout="30000" />
<sync
replTimeout="50000" />
<l1 enabled="false" />
</clustering>
<locking
lockAcquisitionTimeout="20000"
writeSkewCheck="false"
concurrencyLevel="5000"
useLockStriping="false" />
<loaders shared="true" preload="true">
<loader class="org.infinispan.loaders.jdbm.JdbmCacheStore" fetchPersistentState="false" ignoreModifications="false" purgeOnStartup="false">
<properties>
<property name="location" value="/usr/local/tc/.index/data" />
</properties>
</loader>
</loaders>
</namedCache>
<namedCache
name="LuceneIndexesLocking">
<clustering
mode="replication">
<stateRetrieval
fetchInMemoryState="true"
logFlushTimeout="30000" />
<sync
replTimeout="50000" />
<l1 enabled="false" />
</clustering>
<locking
lockAcquisitionTimeout="20000"
writeSkewCheck="false"
concurrencyLevel="5000"
useLockStriping="false" />
</namedCache>
jGroups (UDP):
<config xmlns="urn:org:jgroups"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/JGroups-2.12.xsd">
<UDP
mcast_addr="${jgroups.udp.mcast_addr:228.10.10.9}"
mcast_port="${jgroups.udp.mcast_port:45599}"
tos="8"
ucast_recv_buf_size="20000000"
ucast_send_buf_size="640000"
mcast_recv_buf_size="25000000"
mcast_send_buf_size="640000"
loopback="true"
discard_incompatible_packets="true"
max_bundle_size="64000"
max_bundle_timeout="30"
ip_ttl="${jgroups.udp.ip_ttl:2}"
enable_bundling="true"
enable_diagnostics="false"
thread_naming_pattern="pl"
thread_pool.enabled="true"
thread_pool.min_threads="2"
thread_pool.max_threads="30"
thread_pool.keep_alive_time="5000"
thread_pool.queue_enabled="false"
thread_pool.queue_max_size="100"
thread_pool.rejection_policy="Discard"
oob_thread_pool.enabled="true"
oob_thread_pool.min_threads="2"
oob_thread_pool.max_threads="30"
oob_thread_pool.keep_alive_time="5000"
oob_thread_pool.queue_enabled="false"
oob_thread_pool.queue_max_size="100"
oob_thread_pool.rejection_policy="Discard"
/>
And the errors we observe:
10-31-2011 13:53:02 ERROR Hibernate Search: Directory writer-3 interceptors.InvocationContextInterceptor: ISPN000136: Execution error
org.infinispan.util.concurrent.TimeoutException: Replication timeout for tc-cluster-0105-21082
at org.infinispan.remoting.transport.AbstractTransport.parseResponseAndAddToResponseList(AbstractTransport.java:71)
at org.infinispan.remoting.transport.jgroups.JGroupsTransport.invokeRemotely(JGroupsTransport.java:452)
at org.infinispan.remoting.rpc.RpcManagerImpl.invokeRemotely(RpcManagerImpl.java:132)
at org.infinispan.remoting.rpc.RpcManagerImpl.invokeRemotely(RpcManagerImpl.java:156)
at org.infinispan.remoting.rpc.RpcManagerImpl.invokeRemotely(RpcManagerImpl.java:265)
at org.infinispan.remoting.rpc.RpcManagerImpl.invokeRemotely(RpcManagerImpl.java:252)
at org.infinispan.remoting.rpc.RpcManagerImpl.broadcastRpcCommand(RpcManagerImpl.java:235)
at org.infinispan.remoting.rpc.RpcManagerImpl.broadcastRpcCommand(RpcManagerImpl.java:228)
at org.infinispan.interceptors.ReplicationInterceptor.handleCrudMethod(ReplicationInterceptor.java:116)
at org.infinispan.interceptors.ReplicationInterceptor.visitPutKeyValueCommand(ReplicationInterceptor.java:79)
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:77)
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:119)
at org.infinispan.interceptors.LockingInterceptor.visitPutKeyValueCommand(LockingInterceptor.java:294)
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:77)
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:119)
at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:133)
at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:60)
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:77)
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:119)
at org.infinispan.interceptors.TxInterceptor.enlistWriteAndInvokeNext(TxInterceptor.java:214)
at org.infinispan.interceptors.TxInterceptor.visitPutKeyValueCommand(TxInterceptor.java:162)
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:77)
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:119)
at org.infinispan.interceptors.CacheMgmtInterceptor.visitPutKeyValueCommand(CacheMgmtInterceptor.java:114)
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:77)
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:119)
at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:104)
at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:64)
at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:60)
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:77)
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:119)
at org.infinispan.interceptors.BatchingInterceptor.handleDefault(BatchingInterceptor.java:77)
at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:60)
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:77)
at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:274)
at org.infinispan.CacheImpl.putIfAbsent(CacheImpl.java:524)
at org.infinispan.CacheSupport.putIfAbsent(CacheSupport.java:74)
at org.infinispan.lucene.locking.BaseLuceneLock.obtain(BaseLuceneLock.java:65)
at org.apache.lucene.store.Lock.obtain(Lock.java:72)
at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:1097)
at org.hibernate.search.backend.Workspace.createNewIndexWriter(Workspace.java:202)
at org.hibernate.search.backend.Workspace.getIndexWriter(Workspace.java:180)
at org.hibernate.search.backend.impl.lucene.PerDPQueueProcessor.run(PerDPQueueProcessor.java:103)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Because this error is so pervasive regardless of our topology or caching mode, we believe we must be misconfigured somewhere. Can anyone recommend a fix?
Turns out we had a version clash between Infinispan and Hibernate Search. If you use Hibernate Search 3.4.1, you must use Infinispan 4.2.1, later versions may not work.