Reputation: 33605
I am trying to apply the example in : Switching from JMS to HTTP in Integration Studio 8.1.0
I added the following jars inside lib folder (Integartion_Studio\lib) :
activemq-broker-5.8.0.jar
activemq-client-5.8.0.jar
activemq-kahadb-store-5.8.0.jar
geronimo-jms_1.1_spec-1.1.1.jar
geronimo-j2ee-management_1.1_spec-1.0.1.jar
geronimo-jta_1.0.1B_spec-1.0.1.jar
hawtbuf-1.9.jar
Slf4j-api-1.6.6.jar
activeio-core-3.1.4.jar (available in the ACTIVEMQ_HOME/lib/optional directory)
The proxy service configuration is as follows (exactly like the example) :
<proxy xmlns="http://ws.apache.org/ns/synapse" name="JMStoHTTPStockQuoteProxy" transports="jms">
<target>
<inSequence>
<property action="set" name="OUT_ONLY" value="true"/>
<send>
<endpoint>
<address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
</endpoint>
</send>
</inSequence>
</target>
<parameter name="transport.jms.ContentType">
<rules>
<jmsProperty>contentType</jmsProperty>
<default>text/xml</default>
</rules>
</parameter>
<parameter name="transport.jms.Destination">Queue1</parameter>
<parameter name="transport.jms.ConnectionFactory">myQueueListener</parameter>
</proxy>
deployment.toml (Integartion_Studio\runtime\microesb\conf) :
[transport.jms]
sender_enable = true
listener_enable = true
[[transport.jms.sender]]
name = "myTopicSender"
parameter.initial_naming_factory = "org.apache.activemq.jndi.ActiveMQInitialContextFactory"
parameter.provider_url = "tcp://localhost:61616"
parameter.connection_factory_name = "TopicConnectionFactory"
parameter.connection_factory_type = "topic"
parameter.cache_level = "producer"
[[transport.jms.sender]]
name = "myQueueSender"
parameter.initial_naming_factory = "org.apache.activemq.jndi.ActiveMQInitialContextFactory"
parameter.provider_url = "tcp://localhost:61616"
parameter.connection_factory_name = "QueueConnectionFactory"
parameter.connection_factory_type = "queue"
parameter.cache_level = "producer"
[[transport.jms.listener]]
name = "myQueueListener"
parameter.initial_naming_factory = "org.apache.activemq.jndi.ActiveMQInitialContextFactory"
parameter.provider_url = "tcp://localhost:61616"
parameter.connection_factory_name = "QueueConnectionFactory"
parameter.connection_factory_type = "queue"
but when running the micro integrator I get the following errors :
INFO {JMSListener} - JMS listener started
WARN {JMSListener} - Unable to configure the service StockQuoteProxy for the JMS transport: Service doesn't have configuration information for transport jms. This service is being marked as faulty and will not be available over the JMS transport.
WARN {JMSListener} - Disabling the jms transport for the service StockQuoteProxy, because it is not configured properly for the service
UPDATE: Found the following exception in console :
[2022-12-28 09:45:51,469] INFO {JMSSender} - JMS Sender started
[2022-12-28 09:45:51,517] ERROR {JMSConnectionFactoryManager} - Error setting up connection factory : myQueueSender org.apache.axis2.transport.jms.AxisJMSException: Cannot acquire JNDI context, JMS Connection factory : QueueConnectionFactory or default destination : null for JMS CF : myQueueSender using : {java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory, java.naming.provider.url=tcp://127.0.0.1:61616, transport.jms.ConnectionFactoryType=queue, transport.jms.CacheLevel=producer, transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory}
at org.apache.axis2.transport.jms.JMSConnectionFactory.initJMSConnectionFactory(JMSConnectionFactory.java:192)
at org.apache.axis2.transport.jms.JMSConnectionFactory.<init>(JMSConnectionFactory.java:156)
at org.apache.axis2.transport.jms.JMSConnectionFactoryManager.loadConnectionFactoryDefinitions(JMSConnectionFactoryManager.java:89)
at org.apache.axis2.transport.jms.JMSConnectionFactoryManager.<init>(JMSConnectionFactoryManager.java:76)
at org.apache.axis2.transport.jms.JMSSender.init(JMSSender.java:85)
at org.apache.axis2.context.ConfigurationContextFactory.initTransportSenders(ConfigurationContextFactory.java:300)
at org.apache.axis2.context.ConfigurationContextFactory.init(ConfigurationContextFactory.java:231)
at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:93)
at org.wso2.micro.core.CarbonConfigurationContextFactory.createNewConfigurationContext(CarbonConfigurationContextFactory.java:66)
at org.wso2.micro.integrator.core.internal.CoreServerInitializer.initializeCarbon(CoreServerInitializer.java:209)
at org.wso2.micro.integrator.core.internal.CoreServerInitializer.initMIServer(CoreServerInitializer.java:125)
at org.wso2.micro.integrator.core.internal.Activator.start(Activator.java:92)
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:842)
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:834)
at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:791)
at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1013)
at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:365)
at org.eclipse.osgi.container.Module.doStart(Module.java:598)
at org.eclipse.osgi.container.Module.start(Module.java:462)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$1.run(ModuleContainer.java:1820)
at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$2$1.execute(EquinoxContainerAdaptor.java:150)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1813)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1770)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1735)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1661)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
Caused by: javax.naming.NoInitialContextException: Cannot instantiate class: org.apache.activemq.jndi.ActiveMQInitialContextFactory [Root exception is java.lang.ClassNotFoundException: org.apache.activemq.jndi.ActiveMQInitialContextFactory]
at java.naming/javax.naming.spi.NamingManager.getFactory(NamingManager.java:749)
at java.naming/javax.naming.spi.NamingManager.lambda$getInitialContext$1(NamingManager.java:711)
at java.base/jdk.internal.loader.AbstractClassLoaderValue$Memoizer.get(AbstractClassLoaderValue.java:329)
at java.base/jdk.internal.loader.AbstractClassLoaderValue.computeIfAbsent(AbstractClassLoaderValue.java:205)
at java.naming/javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:711)
at java.naming/javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:305)
at java.naming/javax.naming.InitialContext.init(InitialContext.java:236)
at java.naming/javax.naming.InitialContext.<init>(InitialContext.java:208)
at org.apache.axis2.transport.jms.JMSConnectionFactory.initJMSConnectionFactory(JMSConnectionFactory.java:178)
... 29 more
Caused by: java.lang.ClassNotFoundException: org.apache.activemq.jndi.ActiveMQInitialContextFactory
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at org.eclipse.osgi.internal.framework.ContextFinder.loadClass(ContextFinder.java:139)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:398)
at java.naming/com.sun.naming.internal.VersionHelper.loadClass(VersionHelper.java:123)
at java.naming/com.sun.naming.internal.VersionHelper.loadClass(VersionHelper.java:96)
at java.naming/javax.naming.spi.NamingManager.getFactory(NamingManager.java:746)
... 37 more
[2022-12-28 09:45:51,519] ERROR {JMSConnectionFactoryManager} - Error setting up connection factory : myTopicSender org.apache.axis2.transport.jms.AxisJMSException: Cannot acquire JNDI context, JMS Connection factory : TopicConnectionFactory or default destination : null for JMS CF : myTopicSender using : {java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory, java.naming.provider.url=tcp://127.0.0.1:61616, transport.jms.ConnectionFactoryType=topic, transport.jms.CacheLevel=producer, transport.jms.ConnectionFactoryJNDIName=TopicConnectionFactory}
at org.apache.axis2.transport.jms.JMSConnectionFactory.initJMSConnectionFactory(JMSConnectionFactory.java:192)
at org.apache.axis2.transport.jms.JMSConnectionFactory.<init>(JMSConnectionFactory.java:156)
at org.apache.axis2.transport.jms.JMSConnectionFactoryManager.loadConnectionFactoryDefinitions(JMSConnectionFactoryManager.java:89)
at org.apache.axis2.transport.jms.JMSConnectionFactoryManager.<init>(JMSConnectionFactoryManager.java:76)
at org.apache.axis2.transport.jms.JMSSender.init(JMSSender.java:85)
at org.apache.axis2.context.ConfigurationContextFactory.initTransportSenders(ConfigurationContextFactory.java:300)
at org.apache.axis2.context.ConfigurationContextFactory.init(ConfigurationContextFactory.java:231)
at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:93)
at org.wso2.micro.core.CarbonConfigurationContextFactory.createNewConfigurationContext(CarbonConfigurationContextFactory.java:66)
at org.wso2.micro.integrator.core.internal.CoreServerInitializer.initializeCarbon(CoreServerInitializer.java:209)
at org.wso2.micro.integrator.core.internal.CoreServerInitializer.initMIServer(CoreServerInitializer.java:125)
at org.wso2.micro.integrator.core.internal.Activator.start(Activator.java:92)
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:842)
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:834)
at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:791)
at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1013)
at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:365)
at org.eclipse.osgi.container.Module.doStart(Module.java:598)
at org.eclipse.osgi.container.Module.start(Module.java:462)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$1.run(ModuleContainer.java:1820)
at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$2$1.execute(EquinoxContainerAdaptor.java:150)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1813)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1770)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1735)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1661)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
Caused by: javax.naming.NoInitialContextException: Cannot instantiate class: org.apache.activemq.jndi.ActiveMQInitialContextFactory [Root exception is java.lang.ClassNotFoundException: org.apache.activemq.jndi.ActiveMQInitialContextFactory]
at java.naming/javax.naming.spi.NamingManager.getFactory(NamingManager.java:749)
at java.naming/javax.naming.spi.NamingManager.lambda$getInitialContext$1(NamingManager.java:711)
at java.base/jdk.internal.loader.AbstractClassLoaderValue$Memoizer.get(AbstractClassLoaderValue.java:329)
at java.base/jdk.internal.loader.AbstractClassLoaderValue.computeIfAbsent(AbstractClassLoaderValue.java:205)
at java.naming/javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:711)
at java.naming/javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:305)
at java.naming/javax.naming.InitialContext.init(InitialContext.java:236)
at java.naming/javax.naming.InitialContext.<init>(InitialContext.java:208)
at org.apache.axis2.transport.jms.JMSConnectionFactory.initJMSConnectionFactory(JMSConnectionFactory.java:178)
... 29 more
Caused by: java.lang.ClassNotFoundException: org.apache.activemq.jndi.ActiveMQInitialContextFactory
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at org.eclipse.osgi.internal.framework.ContextFinder.loadClass(ContextFinder.java:139)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:398)
at java.naming/com.sun.naming.internal.VersionHelper.loadClass(VersionHelper.java:123)
at java.naming/com.sun.naming.internal.VersionHelper.loadClass(VersionHelper.java:96)
at java.naming/javax.naming.spi.NamingManager.getFactory(NamingManager.java:746)
... 37 more
[2022-12-28 09:45:51,519] INFO {JMSSender} - JMS Transport Sender initialized...
[2022-12-28 09:45:52,570] ERROR {JMSConnectionFactoryManager} - Error setting up connection factory : myQueueListener org.apache.axis2.transport.jms.AxisJMSException: Cannot acquire JNDI context, JMS Connection factory : QueueConnectionFactory or default destination : null for JMS CF : myQueueListener using : {java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory, java.naming.provider.url=tcp://127.0.0.1:61616, transport.jms.ConnectionFactoryType=queue, transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory}
at org.apache.axis2.transport.jms.JMSConnectionFactory.initJMSConnectionFactory(JMSConnectionFactory.java:192)
at org.apache.axis2.transport.jms.JMSConnectionFactory.<init>(JMSConnectionFactory.java:156)
at org.apache.axis2.transport.jms.JMSConnectionFactoryManager.loadConnectionFactoryDefinitions(JMSConnectionFactoryManager.java:89)
at org.apache.axis2.transport.jms.JMSConnectionFactoryManager.<init>(JMSConnectionFactoryManager.java:76)
at org.apache.axis2.transport.jms.JMSListener.doInit(JMSListener.java:70)
at org.apache.axis2.transport.base.AbstractTransportListenerEx.init(AbstractTransportListenerEx.java:62)
at org.apache.axis2.engine.ListenerManager.init(ListenerManager.java:84)
at org.wso2.micro.integrator.core.internal.CoreServerInitializer.initializeCarbon(CoreServerInitializer.java:220)
at org.wso2.micro.integrator.core.internal.CoreServerInitializer.initMIServer(CoreServerInitializer.java:125)
at org.wso2.micro.integrator.core.internal.Activator.start(Activator.java:92)
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:842)
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:834)
at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:791)
at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1013)
at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:365)
at org.eclipse.osgi.container.Module.doStart(Module.java:598)
at org.eclipse.osgi.container.Module.start(Module.java:462)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$1.run(ModuleContainer.java:1820)
at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$2$1.execute(EquinoxContainerAdaptor.java:150)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1813)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1770)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1735)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1661)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)
Caused by: javax.naming.NoInitialContextException: Cannot instantiate class: org.apache.activemq.jndi.ActiveMQInitialContextFactory [Root exception is java.lang.ClassNotFoundException: org.apache.activemq.jndi.ActiveMQInitialContextFactory]
at java.naming/javax.naming.spi.NamingManager.getFactory(NamingManager.java:749)
at java.naming/javax.naming.spi.NamingManager.lambda$getInitialContext$1(NamingManager.java:711)
at java.base/jdk.internal.loader.AbstractClassLoaderValue$Memoizer.get(AbstractClassLoaderValue.java:329)
at java.base/jdk.internal.loader.AbstractClassLoaderValue.computeIfAbsent(AbstractClassLoaderValue.java:205)
at java.naming/javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:711)
at java.naming/javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:305)
at java.naming/javax.naming.InitialContext.init(InitialContext.java:236)
at java.naming/javax.naming.InitialContext.<init>(InitialContext.java:208)
at org.apache.axis2.transport.jms.JMSConnectionFactory.initJMSConnectionFactory(JMSConnectionFactory.java:178)
... 27 more
Caused by: java.lang.ClassNotFoundException: org.apache.activemq.jndi.ActiveMQInitialContextFactory
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at org.eclipse.osgi.internal.framework.ContextFinder.loadClass(ContextFinder.java:139)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:398)
at java.naming/com.sun.naming.internal.VersionHelper.loadClass(VersionHelper.java:123)
at java.naming/com.sun.naming.internal.VersionHelper.loadClass(VersionHelper.java:96)
at java.naming/javax.naming.spi.NamingManager.getFactory(NamingManager.java:746)
... 35 more
Upvotes: 1
Views: 324
Reputation: 33605
Solved After adding the activemq jars inside : Integartion_Studio\runtime\microesb\lib instead of Integartion_Studio\lib
Upvotes: 0