<Resource id="MySonicJmsConnectionFactory" type="javax.jms.ConnectionFactory">
this type implies using AMQ ( org.apache.activemq.ra.ActiveMQManagedConnectionFactory) just define your connection factory using a provider as well: provider="com.kaltire:ConnectionFactory" Romain Manni-Bucau @rmannibucau <https://twitter.com/rmannibucau> | Blog <http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> | LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber <http://www.tomitribe.com> 2015-09-25 16:07 GMT-07:00 dimas <[email protected]>: > Hi Romain, > > This is what i packaged in jar as service-jar.xml > (META-INF/com/company/service-jar.xml) : > > <?xml version="1.0" encoding="UTF-8"?> > > <ServiceJar> > <ServiceProvider > id="genericra" > service="Resource" > types="GenericJMSRA" > class-name="com.sun.genericra.GenericJMSRA"> > ConnectionFactoryClassName = > progress.message.jclient.ConnectionFactory > QueueConnectionFactoryClassName = > progress.message.jclient.QueueConnectionFactory > TopicConnectionFactoryClassName = > progress.message.jclient.TopicConnectionFactory > TopicClassName = progress.message.jclient.Topic > QueueClassName = progress.message.jclient.Queue > </ServiceProvider> > > <ServiceProvider > id="ConnectionFactory" > service="Resource" > types="javax.jms.ConnectionFactory, > javax.jms.QueueConnectionFactory, javax.jms.TopicConnectionFactory, > QueueConnectionFactory, TopicConnectionFactory" > > class-name="com.sun.genericra.outbound.ManagedJMSConnectionFactory"> > ConnectionFactoryJndiName = sonicConnectionFactory > ConnectionValidationEnabled true > </ServiceProvider> > > <ServiceProvider > id="Queue" > service="Resource" > types="javax.jms.Queue, Queue" > class-name="com.sun.genericra.outbound.QueueProxy"> > QueueClassName = progress.message.jclient.Queue > </ServiceProvider> > > <ServiceProvider > id="Topic" > service="Resource" > types="javax.jms.Topic, Topic" > class-name="com.sun.genericra.outbound.TopicProxy"> > DestinationJndiName = kt.kaltire.ari.trigger > TopicClassName = progress.message.jclient.Topic > </ServiceProvider> > </ServiceJar> > > Here is what releven sections of tomee.xml look like: > > <Resource id="MySonicAdapter" type="GenericJMSRA" > provider="com.kaltire:genericra"> > ServerUrl = tcp://sonic.host.com:10400 > UserName = someuser > Password = somepassw > </Resource> > > <Resource id="MySonicJmsConnectionFactory" > type="javax.jms.ConnectionFactory"> > ResourceAdapter = MySonicAdapter > </Resource> > > and here is the error I'm getting at the start up: > > INFO: Creating Resource(id=MySonicJmsConnectionFactory) > Sep 25, 2015 4:03:29 PM org.apache.openejb.util.OpenEJBErrorHandler > handleUnknownError > SEVERE: FATAL ERROR: Unknown error in Assembler. Please send the following > stack trace and this message to [email protected] : > org.apache.xbean.recipe.ConstructionException: Error setting property: > public void > > org.apache.activemq.ra.ActiveMQManagedConnectionFactory.setResourceAdapter(javax.resource.spi.ResourceAdapter) > throws javax.resource.ResourceException > at > org.apache.xbean.recipe.ObjectRecipe.setProperty(ObjectRecipe.java:521) > at > org.apache.xbean.recipe.ObjectRecipe.setProperties(ObjectRecipe.java:371) > at > org.apache.xbean.recipe.ObjectRecipe.internalCreate(ObjectRecipe.java:286) > at > org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:96) > at > org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:61) > at > > org.apache.openejb.assembler.classic.Assembler.doCreateResource(Assembler.java:2562) > at > > org.apache.openejb.assembler.classic.Assembler.createResource(Assembler.java:2442) > at > > org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:527) > at > org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:439) > at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:150) > at org.apache.openejb.OpenEJB.init(OpenEJB.java:298) > at > org.apache.tomee.catalina.TomcatLoader.initialize(TomcatLoader.java:256) > at > org.apache.tomee.catalina.ServerListener.install(ServerListener.java:168) > at > > org.apache.tomee.catalina.ServerListener.lifecycleEvent(ServerListener.java:55) > at > > org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) > at > > org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) > at > > org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402) > at > org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:110) > at org.apache.catalina.startup.Catalina.load(Catalina.java:638) > at org.apache.catalina.startup.Catalina.load(Catalina.java:663) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:497) > at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:280) > at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:454) > Caused by: javax.resource.ResourceException: ResourceAdapter is not of > type: > org.apache.activemq.ra.MessageResourceAdapter > at > > org.apache.activemq.ra.ActiveMQManagedConnectionFactory.setResourceAdapter(ActiveMQManagedConnectionFactory.java:54) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:497) > at > > org.apache.xbean.recipe.ObjectRecipe$MethodMember.setValue(ObjectRecipe.java:641) > at > org.apache.xbean.recipe.ObjectRecipe.setProperty(ObjectRecipe.java:512) > ... 25 more > > > I'm probably missed something because looks like it's trying to initiate > the > ActiveMQ connection factory. > > Dmitry > > > > > -- > View this message in context: > http://tomee-openejb.979440.n4.nabble.com/Connect-to-external-non-ActiveMQ-JMS-server-tp4676331p4676336.html > Sent from the TomEE Users mailing list archive at Nabble.com. >
