我有一个 Web 应用程序部署在 Websphere AS 8.0(主机 A)中,使用 spring-jms 客户端访问远程机器(主机 B)中 WMQ 7.0 中的队列。我已经按照 WAS 8 管理指南中的说明,使用资源链接下的 JMS Provider 在 JNDI 中配置了 WMQ ConnectionFactory 和 WMQ 队列,并将 WMQ 作为消息传递提供者。我还使用测试连接按钮对其进行了测试。它工作正常。我已经按照 Spring JMS 配置配置了 JNDI 模板和 QueueConnectionFactory 和 Queue(Destination)、DestinationResolver 和 JMSTemplate。
但是,当我尝试运行我的服务器并通过 JNDI 访问 WMQ 时,它会引发以下异常:
exception message JMSCC0085: A destination was not specified.; nested exception is **com.ibm.msg.client.jms.DetailedInvalidDestinationException**: JMSCC0085: A destination was not specified. with params [B@775e20e, 1c02f7440b8438e5]
org.springframework.jms.InvalidDestinationException:JMSCC0085:**A destination was not specified**.; nested exception is com.ibm.msg.client.jms.DetailedInvalidDestinationException:**JMSCC0085:A destination was not specified.**
at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:469)
at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:534)
at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:526)
我尝试打印我的默认目标名称,它打印为 queue://QM_MGR/Q1,其中 QM_MGR 是队列管理器的名称,Q1 是 WMQ 中的队列名称。
请注意,我没有在 WMQ 中配置任何 JNDI,在 JNDI 模板中没有配置任何 InitialContextFactory 和 Provider URL,在 web.xml 中没有配置资源引用。
我已经尝试了以上所有方法并失败了。所以我删除了上面提到的配置。
任何人都可以通过指出我为什么会遇到此异常,我缺少什么或详细说明避免此异常的步骤来帮助我吗?提前致谢。