0

我指的是使用 Spring MDP/Activation Spec 连接 IBM MQ 的以下链接。

Spring JMS 和 Websphere MQ

当我在独立的 Maven 应用程序中运行时,我收到以下错误。请帮我解决这个问题。

MQJCA1006:发现了不正确的 JCA 类版本。部署失败。在类路径中找到了 JCA 类,但不是正确的版本。如果应用程序服务器在类路径中找到 connector.jar,则可能会发生此错误。在 J2SE 环境中用于 JMS 的 WebSphere MQ 类需要此 JAR 文件,但在 J2EE 1.4 环境中不需要。

pom.xml:

<properties>
    <ibmmq.version>7.0.1.0</ibmmq.version>
    <spring.version>3.2.12.RELEASE</spring.version>
</properties>

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-context</artifactId>
    <version>${spring.version}</version>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-jms</artifactId>
    <version>${spring.version}</version>
</dependency>
<!-- other spring dependencies -->

<!-- other spring dependencies -->
<dependency>
    <groupId>com.ibm</groupId>
    <artifactId>com.ibm.mqjms</artifactId>
    <version>${ibmmq.version}</version>
</dependency>
<dependency>
    <groupId>com.ibm</groupId>
    <artifactId>connector</artifactId>
    <version>${ibmmq.version}</version>
</dependency>
<!-- other MQ dependencies -->

<dependency>
    <groupId>javax.resource</groupId>
    <artifactId>connector-api</artifactId>
    <version>1.5</version>
</dependency>

例外:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myResourceAdapterBean' defined in class path resource [spring/common-jms-context.xml]: Invocation of init method failed; nested exception is com.ibm.mq.connector.DetailedResourceAdapterInternalException: MQJCA1006: An incorrect version of the JCA classes was found. Deployment failed. The JCA classes were found in the class path but were not the correct version. This error can occur if the application server finds connector.jar in the class path. This JAR file is required by WebSphere MQ classes for JMS in a J2SE environment, but is not required in a J2EE 1.4 environment.
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1514)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
4

0 回答 0