我正在使用 wso2esb4.7.0 和 wso2mb-2.2.0。我希望使用 wso2mb 创建 jms 代理服务。为此,我配置了 wso2mb 和 wso2esb,如下所示:
Wso2esb 配置:(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
axis2.xml 的变化:
取消注释以下代码:
<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>
还从 $MB_HOME/client-lib 复制andes-client-*.jar
到geronimo-jms_1.1_spec-*.jar
$ESB_HOME/repository/components/lib
重新启动服务器。直到它工作正常。
现在希望使用 jms 端口创建服务。它正在创建一个服务,但它立即进入有故障的服务,并且 esb 记录它显示如下错误:
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)
在重新启动它时也会显示错误,例如:
错误 - 名称 ConnectionFactory 的 BaseUtils JNDI 查找返回了 org.wso2.andes.client.AMQQueue,而接口 javax.jms.ConnectionFactory 是预期的 [2015-01-20 10:22:27,709] 错误 - ListenerManager 无法初始化 jmstransport侦听器 org.apache.axis2.transport.base.BaseTransportException:名称 ConnectionFactory 的 JNDI 查找返回了 org.wso2.andes.client.AMQQueue,而接口 javax.jms.ConnectionFactory 是预期的
我的代理配置是:
<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>
为什么这样?他们的 jms 配置有问题吗?请指导我。