问题描述
- weblogic部署tomcat的项目
-
<Could not load user defined listener: org.springframework.web.context.ContextLoaderListener
java.lang.ClassNotFoundException: Class bytes found but defineClass()failed for: 'org.springframework.web.context.ContextLoaderListener'
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:265)
at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:54)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:158)
Truncated. see log file for complete stacktrace
java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericClassLoader.java:338)
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:291)
Truncated. see log file for complete stacktrace<Failed to initialize the application 'WebRoot' due to error weblogic.application.ModuleException: .
weblogic.application.ModuleException:
at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:295)
at weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:176)
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:360)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
Truncated. see log file for complete stacktrace
java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericClassLoader.java:338)
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:291)
Truncated. see log file for complete stacktrace
解决方案
大神们求救啊 在tomcat下可以正常启动访问 迁移到weblogic 下 启动就会报Could not load user defined listener: org.springframework.web.context.ContextLoaderListener
<?xml version="1.0" encoding="UTF-8"?>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
SSH
<!-- 添加对spring的支持 -->
contextConfigLocation
classpath*:config/applicationContext.xml
org.springframework.web.context.ContextLoaderListener
这是我web.xml里的
解决方案二:
http://blog.csdn.net/fujianianhua/article/details/7703050
http://jzgl-javaeye.iteye.com/blog/1315142