当前位置: 动力学知识库 > 问答 > 编程问答 >

wso2 - AXIS2: JNDI lookup of name ConnectionFactory returned a org.jboss.mq.SpyConnectionFactory while a interface javax.jms.ConnectionFactory was expected

问题描述:

I installed a fresh WSO2 ESB version 4.2.3 (last stable up to now) and I configured the JMS transport in the axis2.xml file as following:

<!-- Configuration for JBoss 4.2.2 GA MQ -->

<transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">

<parameter name="SMSOUTQueueConnectionFactory" locked="false">

<parameter name="java.naming.factory.initial" locked="false">org.jnp.interfaces.NamingContextFactory</parameter>

<parameter name="java.naming.factory.url.pkgs" locked="false">org.jboss.naming:org.jnp.interfaces</parameter>

<parameter name="java.naming.provider.url" locked="false">jnp://192.168.10.125:1100</parameter>

<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">ConnectionFactory</parameter>

<parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>

<parameter name="transport.jms.Destination" locked="true">queue/SMSOUTQueue</parameter>

</parameter>

</transportReceiver>

Immediately after, during the startup an error has been found:

15:09:16,585 INFO [STDOUT] 15:09:16,585 ERROR [BaseUtils] JNDI lookup of name ConnectionFactory returned a org.jboss.mq.SpyConnectionFactory while a interface javax.jms.ConnectionFactory was expected

15:09:16,587 INFO [STDOUT] 15:09:16,585 ERROR [ListenerManager] Couldn't initialize the jmstransport listener

org.apache.axis2.transport.base.BaseTransportException: JNDI lookup of name ConnectionFactory returned a org.jboss.mq.SpyConnectionFactory while a interface javax.jms.ConnectionFactory was expected

at org.apache.axis2.transport.base.BaseUtils.handleException(BaseUtils.java:167)

at org.apache.axis2.transport.jms.JMSUtils.lookup(JMSUtils.java:522)

at org.apache.axis2.transport.jms.JMSConnectionFactory.<init>(JMSConnectionFactory.java:92)

at org.apache.axis2.transport.jms.JMSConnectionFactoryManager.loadConnectionFactoryDefinitions(JMSConnectionFactoryManager.java:58)

at org.apache.axis2.transport.jms.JMSConnectionFactoryManager.<init>(JMSConnectionFactoryManager.java:45)

at org.apache.axis2.transport.jms.JMSListener.doInit(JMSListener.java:58)

at org.apache.axis2.transport.base.AbstractTransportListenerEx.init(AbstractTransportListenerEx.java:62)

at org.apache.axis2.engine.ListenerManager.init(ListenerManager.java:84)

at org.wso2.carbon.core.init.CarbonServerManager.initializeCarbon(CarbonServerManager.java:386)

at org.wso2.carbon.core.init.CarbonServerManager.removePendingItem(CarbonServerManager.java:273)

at org.wso2.carbon.core.init.PreAxis2ConfigItemListener.bundleChanged(PreAxis2ConfigItemListener.java:117)

at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:916)

at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:220)

at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:330)

I found a lot of posts where people say to remove the ...WEB-INF/lib/geronimo-jms_1.1_spec-1.1.0.wso2v1.jar, because otherwise synapse doesn't work with any external JMS broker (I found same answer also for Mule ESB), but for me this solution doesn't work.

The problem is very similar to this link.

Any help is very appreciated. Thanks a lot in advance.

网友答案:

This is a bit late reply. But I also encountered same error and able to fix.When trying to connect to a JMS queue deployed in a JBoss Server from WSO2 ESB 4.6.0 and even with removing the jar geronimo-jms_1.1_spec-1.1.0.wso2v1.jar,your mentioned issue was not fixed.

The reason for that is,in your added jboss related jars to ESB/repository/components/lib,there are some other jars,exposing the implementation for javax.jms.. For example in my case there were two additional jars called jboss-j2ee.jar and jbossall-client.jar exposing javax.jms.. What I did was I opened the two jars and removed the exposing package part of javax.jms.* from both.Then the issue was fixed.

Thanks;

分享给朋友:
您可能感兴趣的文章:
随机阅读: