【问题标题】:Websphere Liberty How to get a MDB Listener working?Websphere Liberty 如何让 MDB 监听器工作?
【发布时间】:2019-05-08 07:23:06
【问题描述】:

我正在尝试让 MDB 侦听器在 Websphere Liberty v16.0.0.4 中工作,但在我的 messages.log 中没有收到一条消息,表明需要使用 MDB 侦听器的应用程序已绑定到激活规格。

我有以下信息:

QueueManager: TEST  
Hostname: localhost  
Default ServerConnectionChannel: BAN.TEST.T1   
Portnumber: 5704

Queue Connection Factory:  
JndiName: jms/dbd_pega_CNVBANQCF  
Type TCF/QCF/CF: QCF  
ServerConnectionChannel: BAN.TEST.T1  

Queue 1:  
JndiName: jms/dbd_pega_CNVBAN_ReqQ  
queueName: SRV00026.201206.BAN  

Queue 2:  
JndiName: jms/dbd_pega_CNVBAN_RplQ  
queueName: BAN.RPL.BAN   

Activation Specification:  
JNDI Activation Specification: eis/dbd_pega_cnvbanQAS  
Name Activation Specification: dbd_pega_cnvbanQAS  
The JNDI name of the Destination Queue: jms/dbd_pega_CNVBAN_ReqQ

MDB 侦听器名为CnvMQIbanServices.jar,并放入名为prpc_j2ee14_ws.ear 的ear 文件中。

这是我的server.xml

<xml version="1.0" encoding="UTF-8">
<server description="server">
<featureManager>
<feature>webProfile-7.0</feature>
<feature>localConnector-1.0</feature>
<feature>jdbc-4.1</feature>
<feature>ssl-1.0</feature>
<feature>servlet-3.1</feature>
<feature>ejb-3.2</feature>
<feature>ejbLite-3.2</feature>
<feature>ejbRemote-3.2</feature>
<feature>jndi-1.0</feature>
<feature>jms-2.0</feature>
<feature>jaxws-2.2</feature>
<feature>jaxb-2.2</feature>
<feature>restConnector-2.0</feature>
<feature>wmqJmsClient-2.0</feature>
<feature>jmsMdb-3.2</feature>
</featureManager>
<applicationManager autoExpand="true"/>
<jmsQueueConnectionFactory jndiName="jms/dbd_pega_CNVBANQCF" connectionManagerRef="ConMgr6">
<properties.wmqJms
transportType="CLIENT"
hostName="localhost"
port="5704"
channel="BAN.TEST.T1"
queueManager="TEST"/>
</jmsQueueConnectionFactory>
<connectionManager id="ConMgr6" maxPoolSize="2"/>
<jmsQueue id="jms/dbd_pega_CNVBAN_ReqQ" jndiName="jms/dbd_pega_CNVBAN_ReqQ">
<properties.wmqJms
baseQueueName="SRV00026.201206.BAN"
baseQueueManagerName="TEST"/>
</jmsQueue>
<jmsQueue id="jms/dbd_pega_CNVBAN_RplQ" jndiName="jms/dbd_pega_CNVBAN_RplQ">
<properties.wmqJms
baseQueueName="BAN.RPL.BAN"
baseQueueManagerName="TEST"/>
</jmsQueue>
<jmsActivationSpec id="prpc_j2ee14_ws/CnvMQIbanServices.jar/CnvMQIbanServices_J2CMessageEndpoint">
<properties.wmqJms
transportType="CLIENT"
destinationRef="jms/dbd_pega_CNVBAN_ReqQ"
destinationType="javax.jms.Queue"
hostName="localhost"
port="5704"
channel="BAN.TEST.T1"
queueManager="TEST"/>
</jmsActivationSpec>
</server>

如果我将 MDB Listener 导入到 Websphere Application Server 中的应用程序中,我知道我需要将 MDB Listener.jar 文件绑定到激活规范,所以在这种情况下,将 CnvMQIbanServices.jar 绑定到 eis/dbd_pega_cnvbanQAS,我'我错过了这个,但我需要如何将它放在 server.xml 中,我可能还遗漏了其他东西吗?

【问题讨论】:

  • 您应该仔细检查您的应用程序和 mdb 名称。活动规范 id 应采用 applicationName/moduleName/beanName 格式,其中 applicatonName 是耳朵的名称、moduleName、带有 MDB 的模块的名称以及实际 MDB 的 bean 名称名称。如果你只是部署 jar,你可以省略 applicationName。应用程序和模块名称没有扩展名。因此,在您的情况下,它可能应该类似于id="CnvMQIbanServices/CnvMQIbanServices_J2CMessageEndpoint"。附加来自 startup 的 message.log 中的任何错误。
  • 如果我检查它在 Websphere Application Server 中的状态并转到:“企业应用程序 > prpc_j2ee14_ws > 管理消息端点”我看到以下内容:prpc_j2ee14_ws#CnvMQIbanServices.jar#CnvMQIbanServices_J2CMessageEndpoint (eis/dbd_pega_cnvbanQAS ) 所以我需要编辑这一行: ?我已经尝试了这两种方法,但是对于这两种方法,我都没有在日志中收到 MDB 已绑定到激活规范的消息。

标签: websphere websphere-liberty mq message-driven-bean


【解决方案1】:

为了确定您是否为 jmsActivationSpec id 使用了正确的值,请在启动服务器后查看 messages.log 文件中的警告,如下所示,

com.ibm.ws.ejbcontainer.mdb.internal.MDBRuntimeImpl          W CNTR4015W: The message endpoint for the {MDB_NAME} message-driven bean cannot be activated because the {ACTIVATION_SPEC_NAME} activation specification is not available. The message endpoint will not receive messages until the activation specification becomes available.

使用您看到的 {ACTIVATION_SPEC_NAME} 值作为 jmsActivationSpec id 值。

【讨论】:

  • 如果我的 server.xml 中只有这个关于激活规范:
  • 如果我启动服务器会出现以下错误com.ibm.ws.config.xml.internal.ConfigEvaluator W CWWKG0033W: The value [jms/dbd_pega_CNVBAN_ReqQ] specified for the reference attribute [destinationRef] was not found in the configuration
  • 如果我再将此配置添加到 server.xml: 我不再收到我以前的错误消息,但也没有消息驱动 bean 已被激活或类似的消息。
  • CWWKG0033W 表示处理配置时出错,如果您删除destinationRef 所指的元素,这是有意义的。您没有看到任何与 MDB 相关的具体内容,这让我想知道 MDB 是否没有被处理,或者功能启用是否存在问题。我建议在使用配置启动服务器后发布消息日志输出,如您最初的文章中所示。是否有任何警告或错误显示?它报告的启用功能列表是否符合您的预期?
  • 由于我需要将它们放在其他地方的文件的大小,您可以在此处查看它们:fil.email/MPxDPeCv 并且可以肯定的是,我将 CnvMQIbanServices.jar 文件放入prpc_j2ee14_ws.ear 正确吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2017-07-24
  • 2021-11-01
  • 2014-05-19
  • 2012-08-21
  • 2012-02-03
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多