【问题标题】:Not able to start MDB listner无法启动 MDB 侦听器
【发布时间】:2015-08-30 23:50:15
【问题描述】:

从控制台启动侦听器时出现以下错误。 00000086 MDBListenerIm W WMSG0019E: 无法启动 MDB 侦听器

SolaceJMSMessage1**,JMSDestination 测试队列: com.ibm.websphere.naming.CannotInstantiateObjectException:异常 在 JNDI NamingManager 处理一个 javax.naming.Reference 对象。 [根**例外是 javax.naming.NamingException:JNDI 查找失败 - JNDI 名称必须**** 最小长度为 1]

ejb-jar.xml:

<message-driven id="MessageDriven_jgbmdb_1074133220117">
            <ejb-name>SolaceJMSMessage1</ejb-name>
            <ejb-class>com.package.solace.SolaceJMSMessageMDB</ejb-class>
            <transaction-type>Bean</transaction-type>
            <acknowledge-mode>Auto-acknowledge</acknowledge-mode>
            <message-driven-destination>
               <destination-type>javax.jms.Queue</destination-type>
            </message-driven-destination>
        </message-driven>

ibm-ejb-jar-bnd.xmi:

<ejbBindings xmi:type="ejbbnd:MessageDrivenBeanBinding" xmi:id="MessageDrivenBeanBinding_jgwmdb_1074133220117" listenerInputPortName="testqueueListenerPort">
    <enterpriseBean xmi:type="ejb:MessageDriven" href="META-INF/ejb-jar.xml#MessageDriven_jgbmdb_1074133220117"/>
  </ejbBindings> 

上面的配置有什么遗漏吗?

【问题讨论】:

  • 您使用的是哪个 Websphere 应用服务器?我认为使用注释至少 websphere 6.1+ 你可以避免配置 ejb-jar.xml,你只需要 ibm-ejb-jar-bnd.xmi

标签: java queue jms websphere solace


【解决方案1】:

应用程序 > 应用程序类型 > WebSphere 企业应用程序 > application_name > 管理控制台中的 EJB JNDI 名称。

【讨论】:

【解决方案2】:

我猜从 WAS 7 开始就没有使用监听器端口。尝试将其绑定到激活规范。以下配置适用于 WAS7 及更高版本 (EJB3)。

@MessageDriven(
    mappedName = "jms/myInQueue", activationConfig = {
        @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
        @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge") })
@TransactionManagement(TransactionManagementType.BEAN)
public class BatchUpdateMDB implements MessageListener { }

ejb-jar.xml 为空,在 ibm-ejb.jar-bnd.xml 中:

<message-driven name="BatchUpdateMDB">
    <jca-adapter activation-spec-binding-name="jms/myQueueInActSpec" destination-binding-name="jms/myInQueue"/>
</message-driven>

【讨论】:

    【解决方案3】:

    您可能会发现本指南很有用:

    http://www.solacesystems.com/wp-content/uploads/resources/Solace-JMS-Integration-with-WAS-V7-and-V8.pdf

    这概述了如何在 WAS 中有效地使用 Solace JMS API,并给出了 ejb-jar.xml 和 ibm-ejb-jar-bnd.xml 的示例

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-02-03
      • 2023-03-17
      • 2020-11-04
      • 1970-01-01
      • 2018-06-28
      • 2022-08-05
      • 1970-01-01
      相关资源
      最近更新 更多