错误而wso2esb创建JMS配置(Error while creating JMS configu

2019-10-21 15:20发布

我使用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>

也复制andes-client-*.jargeronimo-jms_1.1_spec-*.jar从$ MB_HOME /客户lib添加到$ ESB_HOME /存储库/组件/ lib目录

重新开始servers.Till它的正常工作。

现在要创建与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)

也同时重新启动它显示像错误:

错误 - 名字连接工厂的BaseUtils JNDI查找返回org.wso2.andes.client.AMQQueue而接口javax.jms.ConnectionFactory预期[二零一五年一月二十日10:22:27709]错误 - ListenerManager无法初始化jmstransport听众org.apache.axis2.transport.base.BaseTransportException:名字连接工厂的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配置中的任何问题? 请指导我。

Answer 1:

在jndi.properties,您已经定义:

  • 的QueueConnectionFactory
  • TopicConnectionFactory的

在axis.xml,您可以使用:

  • 的QueueConnectionFactory
  • TopicConnectionFactory的
  • 而且,在默认的部分,一个“ 连接工厂

我不使用WSO2MB由我不知道这不会是你的问题



文章来源: Error while creating JMS configuration in wso2esb