本文介绍了Spring JMS和IBM Websphere MQ的JMSCS0002的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看到关于此错误的Stack溢出问题,但我仍然无法解决它,所以我想我会提出自己的问题。

I've seen a question or two on Stack overflow regarding this error but I'm still unable to solve it, so I thought I would pose my own question.

这是我的问题:

我正在使用Spring和Spring的JMSTemplate来做一些消息传递和队列工作。我正在尝试从队列中读取。如果我的逻辑在我的代码中是正确的,我不是百分之百肯定,但是当我尝试运行我的应用程序时,我受到了这个例外的欢迎(我只包括了最后一部分):

I'm using Spring and Spring's JMSTemplate to do some messaging and queue work. I'm trying to read from a queue. I'm not 100% positive if my logic is correct in my code, but anytime I try to run my app I am greeted with this exception (I've included only the last section):

Caused by: com.ibm.msg.client.commonservices.CSIException: JMSCS0002
    at com.ibm.msg.client.commonservices.workqueue.PIWorkQueueManager.enqueueItem(PIWorkQueueManager.java:67)
    at com.ibm.msg.client.commonservices.workqueue.WorkQueueManager.enqueue(WorkQueueManager.java:225)
    at com.ibm.msg.client.commonservices.workqueue.WorkQueueManager.enqueue(WorkQueueManager.java:194)
    at com.ibm.msg.client.wmq.common.internal.WMQThreadPool.enqueue(WMQThreadPool.java:91)

现在我很确定这与我的代码无关,因为无论我多少改变逻辑,如果我尝试调用任何一个 JMSTemplate 提供的方法,我收到此异常。在做了一些研究(基于其他堆栈溢出答案)后,我认为它与我的类路径设置方式有关。以下是这些问题的链接:

Now I'm fairly certain this has nothing to do with my code because no matter how much I change my logic, if I try calling any of the methods made available by JMSTemplate, I receive this exception. After doing some research (based on the other stack overflow answers) I assume it has something to do with the way my classpath is setup. Here is a link to those questions:

除此之外,我在IBM的:

In addition to this, here's some info I found on IBM's site:

要为JMS应用程序编译和运行WebSphere MQ类,请使用平台的
CLASSPATH设置,如表1所示。

CLASSPATH = MQ_INSTALLATION_PATH\java\lib\com.ibm.mqjms.jar;
MQ_INSTALLATION_PATH \tools\jms;

CLASSPATH=MQ_INSTALLATION_PATH\java\lib\com.ibm.mqjms.jar; MQ_INSTALLATION_PATH\tools\jms;

我试过这个但它似乎仍然让我失望。这是我在运行的应用程序的.bat文件中添加的内容:

I have tried this however and It still seems to be failing me. Here's what I have added in my .bat file for my application that I run:

c:\ javaa \ jre6 \ bin \\ \\ _javaw -cpC:\\\ ussco \wmsflgint \mqs \mqjms-7.5.0.0.jar; C:\\\\\\\\\\\\\\\\\\\; \\ ussco \wmsflgint \mqs \headers-1.4.2.jar; C:\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ -Xmx256M .... (最后还有更多,但我觉得不相关)

c:\java\jre6\bin\javaw -cp "C:\ussco\wmsflgint\mqs\mqjms-7.5.0.0.jar; C:\ussco\wmsflgint\mqs\mq-7.5.0.0.jar; C:\ussco\wmsflgint\mqs\headers-1.4.2.jar; C:\ussco\wmsflgint\mqs\jmqi-7.5.0.0.jar;" -Xmx256M .... (there's more on the end but I don't feel it's relevant)

我没有正确添加这个吗?

Am I not adding this correctly?

谢谢

推荐答案

这里的问题是你一直在复制并重命名IBM MQ jar文件,因此,在运行时没有Java类路径上的完整集。这可能会导致各种问题和意外异常,例如您遇到的异常。

The problem here is that you have been copying and renaming IBM MQ jar files and, as a result, do not have the full set on the Java class path at runtime. This can lead to all kinds problems and unexpected exceptions, such as the one you are experiencing.

请注意,IBM支持部门不允许复制MQ jar文件,重命名它们和/或将它们捆绑到应用程序中,并使MQ条款和条件无效。 (捆绑到V8和V9可再发行客户端和allclient的应用程序中的规则是微妙的不同;但是你不在这里使用它)。

Please note that copying MQ jar files, renaming them and/or bundling them into applications is not permitted by IBM Support and invalidates the MQ terms and conditions. (The rules are subtlety different for bundling into apps for the V8 and V9 redistributable client and allclient; but your not using that here).

如果您在系统上执行了正确的MQ客户端安装(您应该这样做),然后使用您在知识中心中找到的说明来参考用于Java应用程序的类的com.ibm.mq.jar文件或用于Java类路径上的JMS应用程序的类的com.ibm.mqjms.jar,您的问题将得到解决。

If you perform a proper install of the MQ client onto your system (which you should do) and then use the instructions that you have already found in the Knowledge Center to reference the com.ibm.mq.jar file for classes for Java applications or the com.ibm.mqjms.jar for classes for JMS applications on the Java class path, your problem will be resolved.

这篇关于Spring JMS和IBM Websphere MQ的JMSCS0002的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 12:27