4 Replies Latest reply on Dec 23, 2016 3:09 PM by Thiago Presa

    java.lang.ClassNotFoundException: JspException even with JSP loaded

    Thiago Presa Newbie



      I'm migrating an app from JBoss 5 using Struts 1.3.8 to WF10. So far, I'm stuck with the following problem:


      2016-12-23 15:51:36,433 DEBUG [org.jboss.as.server.deployment] (MSC service thread 1-7) Adding dependency ModuleDependency [identifier=javax.servlet.jsp.api:main, moduleLoader=local module loader @33e5ccce (finder: local module finder @5a42bbf4 (roots: /path/modules,/path/modules/system/layers/base,/path/modules/system/add-ons/keycloak)), export=false, optional=false, importServices=false] to module deployment.app.war:main

      2016-12-23 15:51:36,550 DEBUG [org.jboss.modules] (MSC service thread 1-7) Module deployment.app.war:main defined by Service Module Loader

      2016-12-23 15:51:36,555 DEBUG [org.jboss.as.jpa] (MSC service thread 1-2) loaded persistence provider adapter org.jboss.as.jpa.hibernate5.HibernatePersistenceProviderAdaptor from classloader ModuleClassLoader for Module "org.hibernate:main" from local module loader @33e5ccce (finder: local module finder @5a42bbf4 (roots: /path/modules,/path/modules/system/layers/base,/path/modules/system/add-ons/keycloak))

      2016-12-23 15:51:36,568 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC000001: Failed to start service jboss.deployment.unit."app.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."app.war".POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of deployment "app.war"

          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:154)

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)

          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

          at java.lang.Thread.run(Thread.java:745)

      Caused by: java.lang.RuntimeException: WFLYSRV0177: Error getting reflective information for class com.company.app.ClassName with ClassLoader ModuleClassLoader for Module "deployment.app.war:main" from Service Module Loader

          at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70)

          at org.jboss.as.ee.metadata.MethodAnnotationAggregator.runtimeAnnotationInformation(MethodAnnotationAggregator.java:57)

          at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.handleAnnotations(InterceptorAnnotationProcessor.java:106)

          at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:91)

          at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:76)

          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:147)

          ... 5 more

      Caused by: java.lang.NoClassDefFoundError: JspException

          at java.lang.Class.getDeclaredMethods0(Native Method)

          at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)

          at java.lang.Class.getDeclaredMethods(Class.java:1975)

          at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:80)

          at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:66)

          ... 10 more

      Caused by: java.lang.ClassNotFoundException: JspException from [Module "deployment.app.war:main" from Service Module Loader]

          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)

          at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)

          ... 15 more


      What I don't understand is how JspException can be missing even when the module loader states that javax.servlet.jsp.api is loaded. Is the distinction between local module loader and Service Module Loader relevant?


      Best regards,

      Thiago Presa

        • 1. Re: java.lang.ClassNotFoundException: JspException even with JSP loaded
          Tomaz Cerar Master

          how does your WEB-INF/lib look like?


          can you paste list of jars you have there?

          also paste jboss-all.xml / jboss-deployment-structure.xml if you have it in your deployment.

          • 2. Re: java.lang.ClassNotFoundException: JspException even with JSP loaded
            Thiago Presa Newbie

            No jboss-all.xml, nor jboss-delpoyment-structure.xml nor MANIFEST.MF



            total 27M

            drwxr-xr-x 2 user user 4,0K Dec 23 16:25 .

            drwxr-xr-x 5 user user 4,0K Dec 23 14:56 ..

            -rw-r--r-- 1 user user  68K Aug 24  2015 activation-1.1.1.jar

            -rw-r--r-- 1 user user 350K Apr 18  2016 antlr-2.7.2.jar

            -rw-r--r-- 1 user user 1,6M Aug 24  2015 axis-1.4.jar

            -rw-r--r-- 1 user user  31K Aug 24  2015 axis-jaxrpc-1.4.jar

            -rw-r--r-- 1 user user  19K Aug 24  2015 axis-saaj-1.4.jar

            -rw-r--r-- 1 user user  58K Dec 22  2015 business-3.1.jar

            -rw-r--r-- 1 user user 595K Nov 11  2015 c3p0-

            -rw-r--r-- 1 user user  19K Dec 22 17:28 cdl-client-1.0.2.jar

            -rw-r--r-- 1 user user 229K Nov 11  2015 commons-beanutils-1.9.2.jar

            -rw-r--r-- 1 user user  88K Apr 18  2016 commons-chain-1.1.jar

            -rw-r--r-- 1 user user  72K Nov 11  2015 commons-codec-1.5.jar

            -rw-r--r-- 1 user user 562K Jun  9  2015 commons-collections-3.2.1.jar

            -rw-r--r-- 1 user user 141K Dec 22 17:26 commons-digester-1.8.jar

            -rw-r--r-- 1 user user  75K Aug 24  2015 commons-discovery-0.4.jar

            -rw-r--r-- 1 user user  32K Dec 22 17:32 commons-email-1.2.jar

            -rw-r--r-- 1 user user 204K Dec 22 17:38 commons-io-2.5.jar

            -rw-r--r-- 1 user user 278K Jun 26  2015 commons-lang-2.6.jar

            -rw-r--r-- 1 user user  60K Jul  6  2015 commons-logging-1.1.1.jar

            -rw-r--r-- 1 user user 287K Dec 22 17:24 commons-net-3.4.jar

            -rw-r--r-- 1 user user 136K Apr 18  2016 commons-validator-1.3.1.jar

            -rw-r--r-- 1 user user 201K Dec 22 17:31 fontbox-1.8.2.jar

            -rw-r--r-- 1 user user 3,1M Dec 22 17:33 icu4j-3.4.4.jar

            -rw-r--r-- 1 user user 1,6M Dec 22 17:58 itextpdf-5.1.3.jar

            -rw-r--r-- 1 user user  39K Aug 24  2015 jackson-annotations-2.5.0.jar

            -rw-r--r-- 1 user user 225K Dec  3  2015 jackson-core-2.5.4.jar

            -rw-r--r-- 1 user user 1,1M Dec  3  2015 jackson-databind-2.5.4.jar

            -rw-r--r-- 1 user user 1,9M Dec 22 17:40 jasperreports-2.0.5.jar

            -rw-r--r-- 1 user user  20K Oct 24 09:54 javax.json-api-1.0.jar

            -rw-r--r-- 1 user user 303K Aug 24  2015 jcommon-1.0.16.jar

            -rw-r--r-- 1 user user 3,8M Dec 22 17:40 jdtcore-3.2.0.v_658.jar

            -rw-r--r-- 1 user user  50K Dec 22 17:31 jempbox-1.8.2.jar

            -rw-r--r-- 1 user user 1,4M Aug 24  2015 jfreechart-1.0.13.jar

            -rw-r--r-- 1 user user 709K Dec 22 17:43 jxl-2.6.12.jar

            -rw-r--r-- 1 user user    0 Dec 23 16:25 lib.txt

            -rw-r--r-- 1 user user 438K Dec 22 17:32 mail-1.4.1.jar

            -rw-r--r-- 1 user user  64K Jun  9  2015 oro-2.0.8.jar

            -rw-r--r-- 1 user user 3,8M Dec 22 17:31 pdfbox-1.8.2.jar

            -rw-r--r-- 1 user user 1,8M Dec 22 17:41 poi-3.9.jar

            -rw-r--r-- 1 user user 367K Dec 23  2015 presentation-3.1.jar

            -rw-r--r-- 1 user user 645K Dec 22 15:37 quartz-2.2.1.jar

            -rw-r--r-- 1 user user  20K Jan 28  2014 sceb-0.0.1.jar

            -rw-r--r-- 1 user user  41K Aug 17 14:28 security-3.1.jar

            -rw-r--r-- 1 user user 322K Apr 18  2016 struts-core-1.3.8.jar

            -rw-r--r-- 1 user user 246K Apr 18  2016 struts-taglib-1.3.8.jar

            -rw-r--r-- 1 user user 145K Aug 24  2015 wsdl4j-1.6.2.jar

            -rw-r--r-- 1 user user 190K Nov 11  2015 xml-apis-1.3.02.jar

            • 3. Re: java.lang.ClassNotFoundException: JspException even with JSP loaded
              Tomaz Cerar Master

              There is quite some mess in your libs, you could probably cleanup quite well.

              But noting that could cause the issue you are seeing.


              What seems odd to me is that class that is missing is just "JspException" without package name.

              This is the real problem. As every CNFE contains full class name. and if this is full class name there must be some code somewhere that is using it wrongly.

              And problem is related to some annotation in your deployment. or any of the jars in the lib.


              Just quick look suggests you could probably remove

              - xml-apis-1.3.02.jar

              - mail-1.4.1.jar

              - jackson-*.jar <-- this is part of resteasy integration and no need to bundle it

              - jdtcore-3.2.0.v_658.jar - eclipse compiler, this should probably be removed

              - javax.json-api-1.0.jar this is api that is provided by server, so should not be bundled

              - activation-1.1.1.jar this is part of JDK

              -  c3p0- - jdbc connection pooling, if you are using server manged datasources this is not needed

              • 4. Re: java.lang.ClassNotFoundException: JspException even with JSP loaded
                Thiago Presa Newbie

                Yes, it's pretty messy, but we're working on it. Thanks for the suggestions, I'll remove them.


                I was discussing with my colleague, and we suspect from a couple of house-made old jars from that list. We're going to try to recompile them and see if this solves the issue. Thanks for the help!