Java Tomcat上的Spring应用程序在weblogic.jar中找不到类
我正在尝试在Tomcat7上部署一个应用程序,该应用程序使用spring 3.1.1和weblogic 10.3,但我一直收到一个NoClassDef异常:Java Tomcat上的Spring应用程序在weblogic.jar中找不到类,java,tomcat7,noclassdeffounderror,weblogic-10.x,spring-3,Java,Tomcat7,Noclassdeffounderror,Weblogic 10.x,Spring 3,我正在尝试在Tomcat7上部署一个应用程序,该应用程序使用spring 3.1.1和weblogic 10.3,但我一直收到一个NoClassDef异常: java.lang.NoClassDefFoundError: Could not initialize class weblogic.jndi.Environment at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$A
java.lang.NoClassDefFoundError: Could not initialize class weblogic.jndi.Environment at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:506) ~[spring-beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
我已经仔细检查和,weblogic jar出现在WEB-INF/lib上,它确实包含上述类:
jar tf WEB-INF/lib/weblogic.jar | grep /Environment.class
weblogic/cluster/messaging/internal/Environment.class
weblogic/jndi/Environment.class
org/mozilla/javascript/tools/shell/Environment.class
当Springbean工厂试图在我的root-context.xml上构建这个bean时,就会发生这种情况
<beans:bean
id="jmsConnectionFactory"
class="org.springframework.jndi.JndiObjectFactoryBean"
p:jndiTemplate-ref="jndiTemplate"
p:jndiName="weblogic.jms.ConnectionFactory" />
我认为这可能是一些类路径问题,但我一直在玩弄webapp的MANIFEST.MF和这个有问题的jarsspring&weblogic有一段时间了,没有任何运气。
关于是什么导致了这种情况,有什么想法吗?我认为直接在类路径中使用weblogic.jar是行不通的。您需要创建wlfullclient.jar并将其放入WEB-INF/lib中
请按照此处给出的说明进行操作: