问题
I'm using wso2esb4.7.0 and wso2mb-2.2.0. I wish to create jms proxy service using wso2mb. For this i have configured the wso2mb as well as wso2esb like :
Wso2esb configuration : (changes in jndi.properties)
# register some connection factories
# connectionfactory.[jndiname] = [ConnectionURL]
connectionfactory.QueueConnectionFactory = amqp://admin:admin@clientID/carbon?brokerlist='tcp://localhost:5673'
connectionfactory.TopicConnectionFactory = amqp://admin:admin@clientID/carbon?brokerlist='tcp://localhost:5673'
# register some queues in JNDI using the form
# queue.[jndiName] = [physicalName]
queue.MyQueue = MyQueue
changes in axis2.xml :
uncomment following code :
<transportSender name="jms" class="org.apache.axis2.transport.jms.JMSSender"/>
<transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
<parameter name="myTopicConnectionFactory" locked="false">
<parameter name="java.naming.factory.initial" locked="false">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</parameter>
<parameter name="java.naming.provider.url" locked="false">repository/conf/jndi.properties</parameter>
<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">TopicConnectionFactory</parameter>
<parameter name="transport.jms.ConnectionFactoryType" locked="false">topic</parameter>
</parameter>
<parameter name="myQueueConnectionFactory" locked="false">
<parameter name="java.naming.factory.initial" locked="false">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</parameter>
<parameter name="java.naming.provider.url" locked="false">repository/conf/jndi.properties</parameter>
<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
<parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
</parameter>
<parameter name="default" locked="false">
<parameter name="java.naming.factory.initial" locked="false">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</parameter>
<parameter name="java.naming.provider.url" locked="false">repository/conf/jndi.properties</parameter>
<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">ConnectionFactory</parameter>
<parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
</parameter>
</transportReceiver>
also copied andes-client-*.jar
and geronimo-jms_1.1_spec-*.jar
from $MB_HOME/client-lib to $ESB_HOME/repository/components/lib
re-started servers.Till it's working fine.
Now wish to create a service with jms port. it is creating a service but immediately it goes to faulty service and esb logs it showing error like :
ERROR - JMSListener Unexpected error when configuring service SampleJMS for the JMS transport. It will be disabled for this transport and marked as faulty.
java.lang.NullPointerException
at org.apache.axis2.transport.jms.JMSListener.getConnectionFactory(JMSListener.java:132)
at org.apache.axis2.transport.jms.JMSEndpoint.loadConfiguration(JMSEndpoint.java:193)
at org.apache.axis2.transport.base.AbstractTransportListenerEx.startListeningForService(AbstractTransportListenerEx.java:153)
at org.apache.axis2.transport.base.AbstractTransportListener.internalStartListeningForService(AbstractTransportListener.java:213)
at org.apache.axis2.transport.base.AbstractTransportListener$2.serviceAdded(AbstractTransportListener.java:126)
at org.apache.axis2.transport.base.tracker.AxisServiceTracker.serviceAdded(AxisServiceTracker.java:212)
at org.apache.axis2.transport.base.tracker.AxisServiceTracker.start(AxisServiceTracker.java:188)
at org.apache.axis2.transport.base.AbstractTransportListener.start(AbstractTransportListener.java:178)
at org.apache.axis2.transport.base.AbstractTransportListenerEx.start(AbstractTransportListenerEx.java:83)
also while restarting it showing error like :
ERROR - BaseUtils JNDI lookup of name ConnectionFactory returned a org.wso2.andes.client.AMQQueue while a interface javax.jms.ConnectionFactory was expected [2015-01-20 10:22:27,709] ERROR - ListenerManager Couldn't initialize the jmstransport listener org.apache.axis2.transport.base.BaseTransportException: JNDI lookup of name ConnectionFactory returned a org.wso2.andes.client.AMQQueue while a interface javax.jms.ConnectionFactory was expected
My proxy configuration is :
<target>
<inSequence>
<property name="Action"
value="urn:placeOrder"
scope="default"
type="STRING"/>
<log level="full"/>
<send>
<endpoint>
<address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<drop/>
</outSequence>
Why so? is their any problem with jms configuration? Please guide me.
回答1:
in jndi.properties, you've defined :
- QueueConnectionFactory
- TopicConnectionFactory
and in axis.xml, you use :
- QueueConnectionFactory
- TopicConnectionFactory
- AND, in the default part, a "ConnectionFactory"
I don't use WSO2MB by I wonder if this would not be your problem
来源:https://stackoverflow.com/questions/28024253/error-while-creating-jms-configuration-in-wso2esb