eclipse3.6 jdk1.5 tomcat6建立web工程后,使用struts2.3.20搭建环境,使用struts_blank后,添加里面相关jar后,启动tomcat,信息如下:
信息: Initializing Coyote HTTP/1.1 on http-8081
2015-6-15 13:37:01 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 718 ms
2015-6-15 13:37:01 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2015-6-15 13:37:01 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.43
2015-6-15 13:37:02 com.opensymphony.xwork2.util.logging.jdk.JdkLogger info
信息: Parsing configuration file [struts-default.xml]
2015-6-15 13:37:02 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter struts2
java.lang.UnsupportedClassVersionError: Bad version number in .class file (unable to load class org.apache.commons.lang3.StringUtils)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2858)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1159)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1647)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:213)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:102)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:240)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:967)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:435)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:479)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:57)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:298)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:119)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4076)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4730)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1060)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:822)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1060)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:759)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
2015-6-15 13:37:02 org.apache.catalina.core.StandardContext start
严重: Error filterStart
2015-6-15 13:37:02 org.apache.catalina.core.StandardContext start
严重: Context [/GSReqManager] startup failed due to previous errors
2015-6-15 13:37:02 org.apache.coyote.http11.Http11Protocol start
信息: Starting Coyote HTTP/1.1 on http-8081
2015-6-15 13:37:03 org.apache.jk.common.ChannelSocket init
信息: JK: ajp13 listening on /0.0.0.0:8009
2015-6-15 13:37:03 org.apache.jk.server.JkMain start
信息: Jk running ID=0 time=0/57 config=null
2015-6-15 13:37:03 org.apache.catalina.startup.Catalina start
信息: Server startup in 1700 ms
参考网友方法无解。最终反编译commons-lang3-3.2.jar后,查询MANIFEST信息如下
Manifest-Version: 1.0
Export-Package: org.apache.commons.lang3;version="3.2",org.apache.comm
ons.lang3.builder;version="3.2",org.apache.commons.lang3.concurrent;v
ersion="3.2",org.apache.commons.lang3.event;version="3.2",org.apache.
commons.lang3.exception;version="3.2",org.apache.commons.lang3.math;v
ersion="3.2",org.apache.commons.lang3.mutable;version="3.2",org.apach
e.commons.lang3.reflect;version="3.2",org.apache.commons.lang3.text;v
ersion="3.2",org.apache.commons.lang3.text.translate;version="3.2",or
g.apache.commons.lang3.time;version="3.2",org.apache.commons.lang3.tu
ple;version="3.2"
Implementation-Title: Apache Commons Lang
Built-By: britter
Tool: Bnd-2.1.0.20130426-122213
Implementation-Vendor: The Apache Software Foundation
Implementation-Vendor-Id: org.apache
Specification-Title: Apache Commons Lang
Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
Bundle-SymbolicName: org.apache.commons.lang3
X-Compile-Target-JDK: 1.6
Implementation-Version: 3.2
Specification-Vendor: The Apache Software Foundation
Bundle-Name: Apache Commons Lang
Created-By: Apache Maven Bundle Plugin
X-Compile-Source-JDK: 1.6
Bundle-Vendor: The Apache Software Foundation
Build-Jdk: 1.7.0_45
Bundle-Version: 3.2.0
Bnd-LastModified: 1388250351290
Bundle-ManifestVersion: 2
Bundle-Description: Apache Commons Lang, a package of Java utility cla
sses for the classes that are in java.lang's hierarchy, or are consi
dered to be so standard as to justify existence in java.lang.
Bundle-DocURL: http://commons.apache.org/proper/commons-lang/
Include-Resource: META-INF/LICENSE.txt=LICENSE.txt,META-INF/NOTICE.txt
=NOTICE.txt
Specification-Version: 3.2
Implementation-Build: tags/LANG_3_2_RC2@r1553875; 2013-12-28 18:05:45+
0100
Archiver-Version: Plexus Archiver
根据信息可知,该包由jdk1.6编译,更换低版本的jar commons-lang3-3.0.jar 后问题解决。启动正常