【问题标题】:Error on JMS Queue because of destination in websphere used by Message Driven Beans由于消息驱动 Bean 使用的 websphere 中的目标,JMS 队列出错
【发布时间】:2013-04-26 17:35:09
【问题描述】:

我收到以下错误:

应用程序 EBS_Calc#EBS_Calc_EJB.jar#MBIntegrations 有一个 useJNDI,在 ResourceAdapter 单元的 ActivationSpec 类 jms/ASQueue(com.ibm.ws.sib.api.jmsra.impl.JmsJcaActivationSpecImpl) 上没有相应的属性/USWSA0102235Node01Cell/nodes/USWSA0102235Node01/servers/server1/resources.xml#J2CResourceAdapter_1364909976437。该属性将被忽略。这可能会产生不良影响。

ActivationSpe W J2CA0161W: 提供的目标 JNDI 名称所引用的对象类型错误。该对象必须实现 javax.jms.destination。目标 JNDI 名称为:jms/ASQueue。提供的对象类是:{1}

ActivationSpe E J2CA0137E: ActivationSpec validate() 方法因 InvalidPropertyException 而失败。 ActivationSpec为jms/ASQueue(com.ibm.ws.sib.api.jmsra.impl.JmsJcaActivationSpecImpl),属于已安装的ResourceAdapter单元格/USWSA0102235Node01Cell/nodes/USWSA0102235Node01/servers/server1/resources.xml#J2CResourceAdapter_1364909976437并关联使用 MDB 应用程序 EBS_Calc#EBS_Calc_EJB.jar#MBIntegrations。请参阅以下失败属性列表及其值:

destination  null
destination  null

...

CWSJR1181E:JMS 激活规范具有无效值 - 未能验证 JMS 激活规范的原因是:[CWSJR1188E:必须为 JMS 激活规范上的目标指定一个值,CWSJR1192E:JMS 激活规范使用队列的目标类型必须具有 [com.ibm.websphere.sib.api.jms.JmsQueue] 类型的目标,但传递的目标类型是 [null]]

我已经在 websphere 中相应地配置了队列、总线和目的地

我的java代码如下:

    @MessageDriven(mappedName = "jms/ASQueue", activationConfig = {
        @ActivationConfigProperty(propertyName = "connectionFactoryJndiName", propertyValue = "jms/CalcConnectionFactory"),         
@ActivationConfigProperty(propertyName = "destinationName", propertyValue = "jms/calcInQueue"),
    @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue")        })

    @Resources ({
      @Resource(name="jms/CalcConnectionFactory",        
                mappedName="jms/CalcConnectionFactory",   // External JNDI name 
                type=javax.jms.ConnectionFactory.class)
     })


    public class MBIntegrations implements MessageListener {

    private static final String CONNECTION_FACTORY_NAME = "jms/CalcConnectionFactory";
    private static final String DESTINATION_NAME = "jms/calcInQueue";

    @Resource
    private MessageDrivenContext mdc;

    private static final Logger logger = Logger.getLogger(MBIntegrations.class);

    public void onMessage(Message inMessage) {

        TextMessage msg = null;

        try {
            if (inMessage instanceof TextMessage) {
                msg = (TextMessage) inMessage;
                logger.info("MESSAGE BEAN: Message received: " + msg.getText());
            } else {
                logger.warn("Message of wrong type: "
                        + inMessage.getClass().getName());
            }

        } catch (JMSException e) {
            e.printStackTrace();
            mdc.setRollbackOnly();
        } catch (Throwable te) {
            te.printStackTrace();
        }

    }

}

和 IBM 活页夹

<message-driven name="MBIntegrations">
        <jca-adapter activation-spec-binding-name="jms/ASQueue"
        destination-binding-name="jms/ASQueue" />
        <resource-ref name="jms/CalcConnectionFactory"
        binding-name="jms/CalcConnectionFactory" />
        <resource-ref name="jdbc/OracleDS" binding-name="jdbc/ORACLE" />
    </message-driven>

我不确定我做错了什么,有人可以帮忙吗?

【问题讨论】:

    标签: jms ejb-3.0 message-queue websphere-7 message-driven-bean


    【解决方案1】:

    查看后发现binder中的问题: http://pic.dhe.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=%2Fcom.ibm.websphere.ejbfep.multiplatform.doc%2Finfo%2Fae%2Fae%2Fcejb_bindingsejbfp.html

    上面写着:

    <jca-adapter activation-spec-binding-name=
     "jms/InternalProviderSpec" 
     destination-binding-name="jms/ServiceQueue"/>
    

    所以在我的情况下应该是:

     ... destination-binding-name="jms/calcInQueue" />
    

    【讨论】:

      【解决方案2】:

      转到 WebSphere 管理控制台

      激活规范 - 打开您的激活规范

      目标 JNDI 名称 - 可能是错误的。如果是主题,请确保您提供主题 jndi 名称。

      【讨论】:

        猜你喜欢
        • 2015-09-27
        • 2015-12-08
        • 2011-01-28
        • 2017-08-04
        • 2012-02-27
        • 2021-08-18
        • 1970-01-01
        • 2016-03-31
        • 2012-07-21
        相关资源
        最近更新 更多