[英]java.lang.NoClassDefFoundError: Could not initialize class com.ibm.mq.jms.MQQueueConnectionFactory
I am facing issue while starting my project. 我开始项目时遇到问题。
Environment: 环境:
Tomcat 6, Jdk_6.45, Alredy added : com.ibm.mq.jar, com.ibm.mqjms.jar, Tomcat 6,Jdk_6.45, Alredy添加了 :com.ibm.mq.jar,com.ibm.mqjms.jar,
Context.xml 的context.xml
<Context>
...
<Resource name="jms/sl.mqfactory" type="com.ibm.mq.jms.MQQueueConnectionFactory"
factory="com.ibm.mq.jms.MQQueueConnectionFactoryFactory" description="JMS Queue Connection Factory"
HOST="mqqs01.s.abc.co.uk" PORT="53162" CHAN="MQ.CLT.BLP.CHL.DEV"
TRAN="1" CCS="819" QMGR="QS01" auth="Container" username="" password="" />
</Context>
Spring: 弹簧:
<bean id="jndiConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="${sl.mqfactory}" /> <!--from properties file -->
<property name="proxyInterface" value="javax.jms.QueueConnectionFactory"/>
</bean>
Exception: 例外:
java.lang.NoClassDefFoundError: Could not initialize class com.ibm.mq.jms.MQQueueConnectionFactory
After going through this link , I added J2ee.jar [without servlet package|folder in jar in my case(1.4.1) ] 通过此链接后 ,我添加了J2ee.jar [在我的情况下(1.4.1)在jar中没有servlet包|文件夹]
And It's working now. 现在正在工作。
if you add j2ee jar with servlet folder tomcat will ignore it with jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/servlet/..
如果在servlet文件夹中添加j2ee jar,tomcat将在jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/servlet/..
忽略它jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/servlet/..
jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/servlet/..
Actually MQQueueConnectionFactory needs javax.resource-api 其实MQQueueConnectionFactory需要javax.resource-api
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.