我最终发现重命名一个名为com.ibm.ws.admin.client_8.5.0.jar的超级IBM jar以“ws ...”开头,导致一切正常,从ant编译到tomcat部署。看来,类加载在WEB-INF / lib目录中是按字母顺序排列的(至少目前为止)。有关此问题的历史,请参阅下文。如果解除“重复”标记,我会将此作为我的问题的答案发布,希望将来有可能帮助其他可能面临此问题的人
我的代码编译得很好,我的应用程序部署到Tomcat 8但是当我的应用程序尝试启动时,我的Tomcat localhost日志中出现以下错误。关于如何解决这个问题的任何想法(甚至如何获得问题的进一步调试信息)?
我在localhost日志上启用了FINE日志记录,并发现了几个没有异常的其他过滤器(请参阅下面更新的日志输出)。为什么 struts2 过滤器特别存在问题而所有其他过滤器都没有?
另一个更新......我为我注释了struts2过滤器(org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
),应用程序安装并启动时没有任何问题。
S2版本是2.3.28。这是我的struts.xml中的约定条目:
<constant name="struts.convention.action.suffix" value="Action" />
<constant name="struts.convention.result.path" value="/" />
<constant name="struts.convention.action.disableJarScanning" value="true" />
<constant name="struts.convention.action.mapAllMatches" value="true"/>
这是tomcat localhost输出:
13-Jul-2016 16:22:36.224 FINE [http-nio-8080-exec-1] org.apache.catalina.core.StandardContext.filterStart Starting filters
13-Jul-2016 16:22:36.224 FINE [http-nio-8080-exec-1] org.apache.catalina.core.StandardContext.filterStart Starting filter 'ApplicationInitFilter'
13-Jul-2016 16:22:53.465 FINE [http-nio-8080-exec-1] org.apache.catalina.core.StandardContext.filterStart Starting filter 'monitoring'
13-Jul-2016 16:22:53.846 FINE [http-nio-8080-exec-1] org.apache.catalina.core.StandardContext.filterStart Starting filter 'Tomcat WebSocket (JSR356) Filter'
13-Jul-2016 16:22:53.846 FINE [http-nio-8080-exec-1] org.apache.catalina.core.StandardContext.filterStart Starting filter 'springSecurityFilterChain'
13-Jul-2016 16:22:53.848 FINE [http-nio-8080-exec-1] org.apache.catalina.core.StandardContext.filterStart Starting filter 'javamelody'
13-Jul-2016 16:22:53.848 FINE [http-nio-8080-exec-1] org.apache.catalina.core.StandardContext.filterStart Starting filter 'struts2'
13-Jul-2016 16:22:54.534 SEVERE [http-nio-8080-exec-1] org.apache.catalina.core.StandardContext.filterStart Exception starting filter struts2
java.lang.IncompatibleClassChangeError: Implementing class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2541)
at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:858)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1301)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1166)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2541)
at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:858)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1301)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1166)
at org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildClassFinder(PackageBasedActionConfigBuilder.java:416)
at org.apache.struts2.convention.PackageBasedActionConfigBuilder.findActions(PackageBasedActionConfigBuilder.java:397)
at org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildActionConfigs(PackageBasedActionConfigBuilder.java:354)
at org.apache.struts2.convention.ClasspathPackageProvider.loadPackages(ClasspathPackageProvider.java:53)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:274)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:970)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:438)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:482)
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.initFilter(ApplicationFilterConfig.java:279)