osgi - Hazelcast Blueprint Camel Karaf -


i new hazelcast , trying implement hazelcast using blueprint , karaf. stuck @ first step in creating instance although working me using spring. when run bundle on karaf, times out. please ignore typo error in bean class name except hazelcast ones changed name security purpose.

here bluprint

<?xml version="1.0" encoding="utf-8"?> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"     xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"     xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"     xmlns:camel="http://camel.apache.org/schema/blueprint" xmlns:hz="http://www.hazelcast.com/schema/spring"     xsi:schemalocation="            http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd            http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd            http://www.hazelcast.com/schema/spring http://www.hazelcast.com/schema/spring/hazelcast-spring-3.5.xsd            ">      <bean id="loadercachemanager" class="com.loadercachemanagerimpl">         <property name="template" ref="producertemplate" />     </bean>      <bean id="mconstatusmessage" class="com.impl.mconstatusmessageimpl" />      <bean id="headerlookupresponseaggregator"         class="com.aggregator.headerlookupresponseaggregator" />      <bean id="headerlookuprequestprocessor" depends-on="producertemplate"         class="com.processor.headerlookuprequestprocessor">         <property name="loadercachemanager" ref="loadercachemanager" />         <property name="assetobjidsql" value="${lookup.asset_objid}" />         <property name="wlanconfigsql" value="${lookup.wlan_config}" />         <property name="tlserrwpaeaptlscodesql" value="${lookup.tlserr_wpa_eaptls_code}" />         <property name="currentdatesql" value="${lookup.currentdate}" />         <property name="hdrobjidsql" value="${lookup.hdrobjid}" />         <property name="deviceidsql" value="${device.lookup}" />     </bean>      <bean id="headerlookupresponseprocessor" depends-on="producertemplate"         class="com.processor.headerlookupresponseprocessor">         <property name="loadercachemanager" ref="loadercachemanager" />     </bean>      <bean id="mconreferencelookupprocessor"         class="com.processor.mconreferencelookupprocessor">         <property name="mconlookupquerysql" value="${mcon_lookup_query}" />     </bean>     <bean id="mconinsertdetailparamprocessor"         class="com.processor.mconinsertdetailparamprocessor">         <property name="mconinsertquery" value="${mcon_insert_query}" />     </bean>     <bean id="rowcountaggregator"         class="com.aggregator.rowcountaggregator" />     <bean id="headerinsertsqlprocessor"         class="com.eaderinsertsqlprocessor">         <property name="headerinsertsql" value="${loader.insertheader}" />     </bean>     <bean id="postloadsqlprocessor"         class="com.ostloadsqlprocessor">         <property name="updatemcsassetsql" value="${postloader.updatecmustatus}" />     </bean>          <bean id="hazelcachedao" class="com.cache.resetvehicleinitial" />     <hz:hazelcast id="instance">         <hz:config>             <hz:network port="5701" port-auto-increment="false">                 <hz:join>                     <hz:multicast enabled="false" />                 </hz:join>             </hz:network>              <hz:map name="rmdmap" read-backup-data="true">                 <hz:map-store enabled="true" write-delay-seconds="3"                     initial-mode="eager" implementation="hazelcachedao" />             </hz:map>          </hz:config>     </hz:hazelcast>   </blueprint> 

below referred maploader class. return null in methods testing purpose.

public class resetvehicleinitial implements maploader<string, string>{       private static final string direct_load_reset_vehicle_initial="direct:loadresetvehicleinitial";      @endpointinject(uri=direct_load_reset_vehicle_initial)     private producertemplate loadresetvehicleinitial;      @override     public string load(string arg0) {         // todo auto-generated method stub         return null;     }      @override     public map<string, string> loadall(collection<string> vehicleintial) {         // todo auto-generated method stub         system.out.println("hello");         list loadvalues = loadresetvehicleinitial.requestbody(direct_load_reset_vehicle_initial, vehicleintial, list.class);         system.out.println(loadvalues);         return null;     }      @override     public iterable<string> loadallkeys() {         // todo auto-generated method stub         return null;     }  } 

after suggestion jereme, modified xml according java class:

<?xml version="1.0" encoding="utf-8"?> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"     xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"     xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"     xmlns:camel="http://camel.apache.org/schema/blueprint" xmlns:hz="http://www.hazelcast.com/schema/spring"     xsi:schemalocation="            http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd            http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd            http://www.hazelcast.com/schema/spring http://www.hazelcast.com/schema/spring/hazelcast-spring-3.5.xsd            ">      <bean id="loadercachemanager" class="com.loadercachemanagerimpl">         <property name="template" ref="producertemplate" />     </bean>      <bean id="mconstatusmessage" class="com.impl.mconstatusmessageimpl" />      <bean id="headerlookupresponseaggregator"         class="com.aggregator.headerlookupresponseaggregator" />      <bean id="headerlookuprequestprocessor" depends-on="producertemplate"         class="com.processor.headerlookuprequestprocessor">         <property name="loadercachemanager" ref="loadercachemanager" />         <property name="assetobjidsql" value="${lookup.asset_objid}" />         <property name="wlanconfigsql" value="${lookup.wlan_config}" />         <property name="tlserrwpaeaptlscodesql" value="${lookup.tlserr_wpa_eaptls_code}" />         <property name="currentdatesql" value="${lookup.currentdate}" />         <property name="hdrobjidsql" value="${lookup.hdrobjid}" />         <property name="deviceidsql" value="${device.lookup}" />     </bean>      <bean id="headerlookupresponseprocessor" depends-on="producertemplate"         class="com.processor.headerlookupresponseprocessor">         <property name="loadercachemanager" ref="loadercachemanager" />     </bean>      <bean id="mconreferencelookupprocessor"         class="com.processor.mconreferencelookupprocessor">         <property name="mconlookupquerysql" value="${mcon_lookup_query}" />     </bean>     <bean id="mconinsertdetailparamprocessor"         class="com.processor.mconinsertdetailparamprocessor">         <property name="mconinsertquery" value="${mcon_insert_query}" />     </bean>     <bean id="rowcountaggregator"         class="com.aggregator.rowcountaggregator" />     <bean id="headerinsertsqlprocessor"         class="com.eaderinsertsqlprocessor">         <property name="headerinsertsql" value="${loader.insertheader}" />     </bean>     <bean id="postloadsqlprocessor"         class="com.ostloadsqlprocessor">         <property name="updatemcsassetsql" value="${postloader.updatecmustatus}" />     </bean>         <bean id="hazelcachedao" class="com.ge.trans.loader.qnx.cache.resetvehicleinitial"/>     <bean id="instance" class="com.hazelcast.core.hazelcast"         factory-method="newhazelcastinstance">         <constructor-arg>             <bean class="com.hazelcast.config.config">                 <property name="groupconfig">                     <bean class="com.hazelcast.config.groupconfig">                         <property name="name" value="local" />                         <property name="password" value="local" />                     </bean>                 </property>                 <property name="networkconfig">                     <bean class="com.hazelcast.config.networkconfig">                         <property name="port" value="7001" />                         <property name="portautoincrement" value="true" />                         <property name="join">                             <bean class="com.hazelcast.config.joinconfig">                                 <property name="multicastconfig">                                     <bean class="com.hazelcast.config.multicastconfig">                                         <property name="enabled" value="false" />                                     </bean>                                 </property>                                 <property name="tcpipconfig">                                     <bean class="com.hazelcast.config.tcpipconfig">                                         <property name="enabled" value="true" />                                         <property name="members" value="3.192.20.22, 3.192.18.110" />                                     </bean>                                 </property>                             </bean>                         </property>                     </bean>                 </property>                 <property name="mapconfigs">                     <map>                         <entry key="datasyncdetails">                             <bean class="com.hazelcast.config.mapconfig">                                 <property name="name" value="rmdmap" />                                 <property name="backupcount" value="2" />                                 <property name="timetoliveseconds" value="0" />                                 <property name="evictionpolicy" value="lru" />                                 <property name="maxidleseconds" value="0" />                                 <property name="evictionpercentage" value="25" />                                 <property name="maxsizeconfig">                                     <bean class="com.hazelcast.config.maxsizeconfig">                                         <property name="size" value="10000"></property>                                         <property name="maxsizepolicy" value="used_heap_percentage"></property>                                     </bean>                                 </property>                                 <property name="mapstoreconfig">                                     <bean class="com.hazelcast.config.mapstoreconfig">                                         <property name="enabled" value="true"></property>                                         <property name="writedelayseconds" value="0"></property>                                         <property name="implementation" ref="hazelcachedao" />                                         <property name="initialloadmode" value="eager"></property>                                     </bean>                                 </property>                             </bean>                         </entry>                     </map>                  </property>             </bean>         </constructor-arg>     </bean>   </blueprint> 

but getting following error now:

org.osgi.service.blueprint.container.componentdefinitionexception: unable validate xml     @ org.apache.aries.blueprint.parser.parser.validate(parser.java:288)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379]     @ org.apache.aries.blueprint.container.blueprintcontainerimpl.dorun(blueprintcontainerimpl.java:317)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379]     @ org.apache.aries.blueprint.container.blueprintcontainerimpl.run(blueprintcontainerimpl.java:261)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379]     @ org.apache.aries.blueprint.container.blueprintextender.createcontainer(blueprintextender.java:270)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379]     @ org.apache.aries.blueprint.container.blueprintextender.modifiedbundle(blueprintextender.java:233)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379]     @ org.apache.aries.util.tracker.hook.bundlehookbundletracker$tracked.customizermodified(bundlehookbundletracker.java:500)[11:org.apache.aries.util:1.0.1.redhat-610379]     @ org.apache.aries.util.tracker.hook.bundlehookbundletracker$tracked.customizermodified(bundlehookbundletracker.java:433)[11:org.apache.aries.util:1.0.1.redhat-610379]     @ org.apache.aries.util.tracker.hook.bundlehookbundletracker$abstracttracked.track(bundlehookbundletracker.java:725)[11:org.apache.aries.util:1.0.1.redhat-610379]     @ org.apache.aries.util.tracker.hook.bundlehookbundletracker$tracked.bundlechanged(bundlehookbundletracker.java:463)[11:org.apache.aries.util:1.0.1.redhat-610379]     @ org.apache.aries.util.tracker.hook.bundlehookbundletracker$bundleeventhook.event(bundlehookbundletracker.java:422)[11:org.apache.aries.util:1.0.1.redhat-610379]     @ org.apache.felix.framework.util.secureaction.invokebundleeventhook(secureaction.java:1103)[org.apache.felix.framework-4.0.3.redhat-610379.jar:]     @ org.apache.felix.framework.util.eventdispatcher.createwhitelistfromhooks(eventdispatcher.java:696)[org.apache.felix.framework-4.0.3.redhat-610379.jar:]     @ org.apache.felix.framework.util.eventdispatcher.firebundleevent(eventdispatcher.java:484)[org.apache.felix.framework-4.0.3.redhat-610379.jar:]     @ org.apache.felix.framework.felix.firebundleevent(felix.java:4650)[org.apache.felix.framework-4.0.3.redhat-610379.jar:]     @ org.apache.felix.framework.felix$4.run(felix.java:2123)[org.apache.felix.framework-4.0.3.redhat-610379.jar:]     @ org.apache.felix.framework.felix.runincontext(felix.java:2147)[org.apache.felix.framework-4.0.3.redhat-610379.jar:]     @ org.apache.felix.framework.felix.startbundle(felix.java:2121)[org.apache.felix.framework-4.0.3.redhat-610379.jar:]     @ org.apache.felix.framework.bundleimpl.start(bundleimpl.java:955)[org.apache.felix.framework-4.0.3.redhat-610379.jar:]     @ org.apache.felix.framework.bundleimpl.start(bundleimpl.java:942)[org.apache.felix.framework-4.0.3.redhat-610379.jar:]     @ org.apache.karaf.features.internal.featuresserviceimpl.installfeatures(featuresserviceimpl.java:474)[22:org.apache.karaf.features.core:2.3.0.redhat-610379]     @ org.apache.karaf.features.internal.featuresserviceimpl.installfeature(featuresserviceimpl.java:404)[22:org.apache.karaf.features.core:2.3.0.redhat-610379]     @ org.apache.karaf.features.internal.featuresserviceimpl.installfeature(featuresserviceimpl.java:400)[22:org.apache.karaf.features.core:2.3.0.redhat-610379]     @ org.apache.karaf.features.command.installfeaturecommand.doexecute(installfeaturecommand.java:62)[26:org.apache.karaf.features.command:2.3.0.redhat-610379]     @ org.apache.karaf.features.command.featurescommandsupport.doexecute(featurescommandsupport.java:41)[26:org.apache.karaf.features.command:2.3.0.redhat-610379]     @ org.apache.karaf.shell.console.osgicommandsupport.execute(osgicommandsupport.java:39)[17:org.apache.karaf.shell.console:2.3.0.redhat-610379]     @ org.apache.felix.gogo.commands.basic.abstractcommand.execute(abstractcommand.java:35)[17:org.apache.karaf.shell.console:2.3.0.redhat-610379]     @ org.apache.felix.gogo.runtime.commandproxy.execute(commandproxy.java:78)[15:org.apache.felix.gogo.runtime:0.11.0.redhat-610379]     @ org.apache.felix.gogo.runtime.closure.executecmd(closure.java:477)[15:org.apache.felix.gogo.runtime:0.11.0.redhat-610379]     @ org.apache.felix.gogo.runtime.closure.executestatement(closure.java:403)[15:org.apache.felix.gogo.runtime:0.11.0.redhat-610379]     @ org.apache.felix.gogo.runtime.pipe.run(pipe.java:108)[15:org.apache.felix.gogo.runtime:0.11.0.redhat-610379]     @ org.apache.felix.gogo.runtime.closure.execute(closure.java:183)[15:org.apache.felix.gogo.runtime:0.11.0.redhat-610379]     @ org.apache.felix.gogo.runtime.closure.execute(closure.java:120)[15:org.apache.felix.gogo.runtime:0.11.0.redhat-610379]     @ org.apache.felix.gogo.runtime.commandsessionimpl.execute(commandsessionimpl.java:89)[15:org.apache.felix.gogo.runtime:0.11.0.redhat-610379]     @ org.apache.karaf.shell.console.jline.console.run(console.java:189)[17:org.apache.karaf.shell.console:2.3.0.redhat-610379]     @ org.apache.karaf.shell.console.jline.delayedstarted.run(delayedstarted.java:61)[17:org.apache.karaf.shell.console:2.3.0.redhat-610379] caused by: org.xml.sax.saxparseexception: cvc-complex-type.2.4.a: invalid content found starting element 'constructor-arg'. 1 of '{"http://www.osgi.org/xmlns/blueprint/v1.0.0":description, "http://www.osgi.org/xmlns/blueprint/v1.0.0":argument, "http://www.osgi.org/xmlns/blueprint/v1.0.0":property, wc[##other:"http://www.osgi.org/xmlns/blueprint/v1.0.0"]}' expected.     @ org.apache.xerces.util.errorhandlerwrapper.createsaxparseexception(unknown source)[:]     @ org.apache.xerces.util.errorhandlerwrapper.error(unknown source)[:]     @ org.apache.xerces.impl.xmlerrorreporter.reporterror(unknown source)[:]     @ org.apache.xerces.impl.xmlerrorreporter.reporterror(unknown source)[:]     @ org.apache.xerces.impl.xmlerrorreporter.reporterror(unknown source)[:]     @ org.apache.xerces.impl.xs.xmlschemavalidator$xsierrorreporter.reporterror(unknown source)[:]     @ org.apache.xerces.impl.xs.xmlschemavalidator.reportschemaerror(unknown source)[:]     @ org.apache.xerces.impl.xs.xmlschemavalidator.handlestartelement(unknown source)[:]     @ org.apache.xerces.impl.xs.xmlschemavalidator.startelement(unknown source)[:]     @ org.apache.xerces.jaxp.validation.domvalidatorhelper.beginnode(unknown source)[:]     @ org.apache.xerces.jaxp.validation.domvalidatorhelper.validate(unknown source)[:]     @ org.apache.xerces.jaxp.validation.domvalidatorhelper.validate(unknown source)[:]     @ org.apache.xerces.jaxp.validation.validatorimpl.validate(unknown source)[:]     @ javax.xml.validation.validator.validate(unknown source)[:2.3.0.redhat-610379]     @ org.apache.aries.blueprint.parser.parser.validate(parser.java:285)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379]     ... 34 more 

you can't mix "spring namespaces" in blueprint configuration, @ least current version of aries (which, apparently, using)

you should create hazelcastinstance in java class, without of 'hz' namespace.

moreover :

  • gemini blueprint, implementation of blueprint, support use of spring namespace in blueprint file
  • spring dm, (which obsolete still work spring <= 3..), can either support use of spring namespace, in spring configuration in meta-inf/spring
  • i have seen experimental support of spring namespace in aries blueprint, have never tryied personnally, it's work-in-progress (i haven't seen "official communication" feature)

Comments