0

I ultimately found that renaming an uber IBM jar named com.ibm.ws.admin.client_8.5.0.jar to start with "ws..." caused everything to work fine, from ant compile to tomcat deploy. It appears that class loading is alphabetical in the WEB-INF/lib dir (at least for now). For history of this issue, see below. If the "duplicate" mark is lifted, I will post this as the answer to my issue to hopefully help others in the future that might face this


My code compiles fine and my app deploys to Tomcat 8 but I'm getting the following error in my Tomcat localhost log when the app attempts to start. Any ideas on how to resolve this (or even how to get further debug info for where the issue is)?

I have enabled FINE logging on the localhost log and found several other filters starting with no exceptions (see below updated log output). Why is the struts2 filter specifically having issues and all of these other filters aren't?

Another update...I commented out the struts2 filter (org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter for me) and the application installs and starts with no issues.

S2 version is 2.3.28. Here are convention entries in my 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"/>

Here's the tomcat localhost output:

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)
Zack Macomber
  • 6,682
  • 14
  • 57
  • 104
  • Multiple versions of the same library.? – Aleksandr M Jul 13 '16 at 18:26
  • looks like we may have 2 versions of commons-pool and commons-collections...could that cause trouble with starting the struts2 filter? – Zack Macomber Jul 13 '16 at 18:35
  • Which S2 version? Can you show your convention configuration? – Aleksandr M Jul 13 '16 at 21:42
  • @AleksandrM Updated post with that info – Zack Macomber Jul 14 '16 at 12:18
  • 1
    Unbelievable...it appears renaming an uber IBM jar named com.ibm.ws.admin.client_8.5.0.jar to start with "ws..." causes everything to work fine, from ant compile to tomcat deploy...it appears that class loading is alphabetical in the WEB-INF/lib dir (at least for now)...what a headache... – Zack Macomber Jul 14 '16 at 16:54
  • 1
    Struts2 filter works fine without extra dependencies you have added to the action classes, so problem is localized in your application, not in struts2 filter. – Roman C Jul 15 '16 at 14:09
  • @RomanC That's a fair observation. I will update my post to reflect that and ultimately point out that class loading was the issue at hand. I don't believe this is a duplicate and would appreciate it if that's taken off so I can tell the world that class loading was the issue and maybe help some developer down the line not have to troubleshoot for 2 days to figure this out...thanks. – Zack Macomber Jul 15 '16 at 14:16
  • @ZackMacomber You don't need to take any action because the linked question has the same problem and already has an answer. if you want to help the world go to the question and upvote both the question and accepted answer, then you can upvote answers that are correct if you feel that answers has a priority, I have no interest to your question anymore. – Roman C Jul 15 '16 at 14:23

0 Answers0