【问题标题】:WAS Liberty Profile connect to MQ ServerWAS Liberty Profile 连接到 MQ 服务器
【发布时间】:2014-11-05 10:17:11
【问题描述】:

我们正在试验 IBM 的 WebSphere Liberty 配置文件。现在我们无法连接到我们的 WebSphere MQ 服务器。它适用于普通的 WebSphere 配置文件。我们按照本教程https://developer.ibm.com/wasdev/2013/06/14/using-websphere-mq-with-the-liberty-profile/ 进行操作,但遇到了以下异常:

Stack Dump = java.lang.ClassNotFoundException: com.ibm.mq.jms.MQQueue

知道我可以改变什么,以便可以找到这个类吗?

我正在使用 Liberty Profile,版本 8.5.5.3。

我的server.xml 如下所示:

<server description="new server">

    <!-- Enable features -->
    <featureManager>
        <feature>jsf-2.0</feature>
        <feature>jpa-2.0</feature>
        <feature>jndi-1.0</feature>
        <feature>localConnector-1.0</feature>
        <feature>beanValidation-1.0</feature>
        <feature>wasJmsClient-1.1</feature>
        <feature>jaxws-2.2</feature>
        <feature>jmsMdb-3.1</feature>
    </featureManager>

    <!-- To access this server from a remote client add a host attribute to the following element, e.g. host="*" -->
    <httpEndpoint id="defaultHttpEndpoint" httpPort="9080" httpsPort="9443" />

    <application id="myapp" name="myApp" type="ear" location="d:\somehwere">
        <classloader delegation="parentLast" commonLibraryRef="global" />
    </application>

    <variable name="wmqJmsClient.rar.location" value="D:\opt\was_liberty_profile\was_8_5_5_3\wlp\usr\shared\wmq\wmq.jmsra.rar"/>

    <library id="global">
        <file name="d:/dev/mavenrepo/com/h2database/h2/1.4.181/h2-1.4.181.jar" />
    </library>

    <jmsQueue id="MYAPP_QUEUE" jndiName="jms/test/testq">
        <properties.wmqJms 
            baseQueueName="MYAPP.TEST.A" 
            persistence="PERS" 
            targetClient="MQ"/>
    </jmsQueue>

    <jmsQueueConnectionFactory id="TEST.SVRCONN.001" jndiName="jms/test/testcf"><!-- connectionManagerRef="ConMgr2">-->
     <properties.wmqJms 
        channel="WM026D.SVRCONN.001" 
        hostName="i19328.myhost.ch" 
        port="1439" 
        queueManager="WM026D" 
        targetClientMatching="false"/>
    </jmsQueueConnectionFactory>

    <jmsActivationSpec id="fvtapp/fvtmdb/FVTMessageDrivenBean">
  <properties.wmqJms destinationRef="MYAPP_QUEUE"
                     destinationType="javax.jms.Queue"
                     queueManager="WM026D"/>
</jmsActivationSpec>
</server>

【问题讨论】:

  • 您能提供您的 server.xml 中的内容吗?我假设您按照教程下载了 wmq 资源适配器?
  • @whitfiea 你的第二个问题是什么意思?我认为我的同事是从 IBM 下载的
  • 我的意思是您下载了 wmq.jmsra.rar,因为它默认是 Liberty 的一部分。正如 Gas 已经提到的问题是你加载了错误的功能,所以你提到的类没有加载。

标签: java jms ibm-mq websphere-liberty


【解决方案1】:

你在那里有错误的功能。应该是:

<feature>wmqJmsClient-1.1</feature>

不是:

<feature>wasJmsClient-1.1</feature>

后一种是用于内置消息传递而不是 MQ。

【讨论】:

  • 谢谢。这是解决方案的第一部分。第二部分,我们将 web.xml 中配置的队列“投射”到 com.ibm.mq.jms.MQQueue。我们将其更改为 java.jms.Queue,现在它可以运行了。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-09-28
  • 1970-01-01
  • 2014-10-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多