【发布时间】:2020-03-10 19:22:15
【问题描述】:
尝试从 WebSphere 8 运行 Java 8 MQ 应用程序时出现以下错误:
java.lang.IllegalStateException: Cannot convert value of type 'com.ibm.ejs.jms.JMSQueueConnectionFactoryHandle' to required type 'javax.jms.ConnectionFactory"
经过一些研究,我在这里看到了一些建议,可以通过删除所有 javax.jms jar 来解决上述错误。我的 war 文件中有 jms-api-2.0 和 geronimo-jms_1.1_spec jar。我删除了它们,之后我看到以下错误:
java.lang.NoClassDefFoundError: javax.jms.JMSRuntimeException
这将需要 JMS jar。请指教。
我的战争中打包的罐子:
spring-boot-starter-web:jar:1.5.17.RELEASE
spring-boot-starter:jar:1.5.17.RELEASE
spring-boot-starter-log4j2:jar:1.5.17.RELEASE
spring-boot-starter-activemq:jar:1.5.17.RELEASE
commons-lang3:jar:3.5
cxf-rt-frontend-jaxws:jar:3.1.11
cxf-rt-transports-http:jar:3.1.11
cxf-rt-ws-security:jar:3.1.11
wss4j-ws-security-common:jar:2.2.1
groovy:jar:2.4.11
gson:jar:2.8.5
spring-boot-configuration-processor:jar:1.5.17.RELEASE
com.ibm.mq:jar:8.0.0.5
com.ibm.mq.headers:jar:8.0.0.5
com.ibm.mq.pcf:jar:8.0.0.5
com.ibm.mqjms:jar:8.0.0.5
com.ibm.mq.connector:jar:7.5.0.5
dhbcore:jar:7.5.0.5
mqcontext:jar:2.3
com.ibm.mq.commonservices:jar:8.0.0.5
jaxb-impl:jar:2.2.11
jaxb-core:jar:2.2.11
spring-oxm:jar:4.3.20.RELEASE
删除所有 com.ibm jar 并添加 com.ibm.mq.allclient 和 jms jar 后,我的 war 文件中的新 jar 列表:
spring-boot-starter-web:jar:1.5.17.RELEASE
spring-boot-starter:jar:1.5.17.RELEASE
spring-boot-starter-log4j2:jar:1.5.17.RELEASE
spring-boot-starter-activemq:jar:1.5.17.RELEASE
commons-lang3:jar:3.5
cxf-rt-frontend-jaxws:jar:3.1.11
cxf-rt-transports-http:jar:3.1.11
cxf-rt-ws-security:jar:3.1.11
wss4j-ws-security-common:jar:2.2.1
groovy:jar:2.4.11
gson:jar:2.8.5
spring-boot-configuration-processor:jar:1.5.17.RELEASE
jaxb-impl:jar:2.2.11
jaxb-core:jar:2.2.11
spring-oxm:jar:4.3.20.RELEASE
javax.jms-api:jar:2.0
com.ibm.mq.allclient:jar:9.1.1.0
【问题讨论】:
-
您运行的是哪个版本的 WAS?
-
你能在你的问题中显示导致错误的代码
-
@JoshMc 我在 WAS 8.5.5.16 上运行它
-
@Morag Hughson 我不认为是导致此问题的代码。因为从本地(tomcat 服务器)运行代码时运行良好。
-
不行,WAS v8.5.5.6自带MQ RAR v7.1.0.6。这本身将包括 jms 1.1。