1

我成功地在我的 websphere 服务器上进行了 MQ 调用。但是我很难在本地码头服务器上做同样的工作。由于 jms 错误,我什至无法在本地启动我的服务器。

我在 websphere 服务器上配置了两个 jndi 名称:

ConnectionFactory- jms/connectionFactory

队列 - jms/cardAcquireQueue

以下是 bean 条目的代码:-

<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate"> 
    <property name="connectionFactory">
         <jee:jndi-lookup jndi-name="jms/connectionFactory"/>
    </property> 
    <property name="defaultDestinationName"> 
         <jee:jndi-lookup jndi-name="jms/cardAcquireQueue"/> 
    </property>
    <property name="pubSubDomain" value="true" /> 
</bean>   

以上在服务器上工作正常。但是对于码头,我在码头有以下代码:-

<Configure class="org.eclipse.jetty.webapp.WebAppContext">
   <New class="org.eclipse.jetty.plus.jndi.Resource">
     <Arg></Arg>
     <Arg>jms/connectionFactory</Arg>
     <Arg>
        <New class="org.apache.activemq.ActiveMQConnectionFactory">
            <Arg>vm://localhost?broker.persistent=false</Arg>
        </New>
     </Arg>
   </New>

   <New class="org.eclipse.jetty.plus.jndi.Resource">
     <Arg></Arg>
     <Arg>jms/cardAcquireQueue</Arg>
     <Arg>
       ------I dont know What needs to be done here -----
     </Arg>
   </New>
</Configure>

我没有从 jms/ConnectionFactory 收到错误,但使用 jms/cardAcquireQueue 我收到返回 null 错误。

你能帮助如何为 jms 队列配置 jndi 名称吗?

4

0 回答 0