3 Replies Latest reply on May 21, 2014 11:10 AM by Tomaz Cerar

    ClassNotFoundException

    stephan schärli Newbie

      If I start Wildfly and deploy my war file I get following ClassNotFoundException.

      Why Wildfy cannot find the exception class?

       

      14:50:07,591 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./Consult.UndertowDeploymentInfoService: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./Consult.UndertowDeploymentInfoService: java.lang.ClassNotFoundException: Exception from [Module "deployment.Consult.war:main" from Service Module Loader]

          at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.createServletConfig(UndertowDeploymentInfoService.java:884)

          at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.start(UndertowDeploymentInfoService.java:245)

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]

          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_25]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_25]

          at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25]

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

          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213) [jboss-modules.jar:1.3.3.Final]

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.3.Final]

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.3.Final]

          at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.3.Final]

          at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.3.Final]

          at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.createServletConfig(UndertowDeploymentInfoService.java:776)

          ... 6 more

       

      Thank you in advance for your answer

        • 1. Re: ClassNotFoundException
          Tomaz Cerar Master

          What version of WildFly?

           

          I am bit guessing here but looks like exception comes from here

           

          errorPage = new ErrorPage(page.getLocation(), (Class<? extends Throwable>) module.getClassLoader().loadClass(page.getExceptionType()));

           

          Which is during resolving error-pages configurations from your web.xml

           

          can you make sure your configuration is correct there?

          • 2. Re: ClassNotFoundException
            stephan schärli Newbie

            Thank you for your answer.

             

            Now I have removed following lines from my web.xml for WildFly 8.0.0 Final and 8.1.0 CR2 and the error disappears.

             

             

            <error-page>
               <exception-type>Exception</exception-type>   
               <location>/faces/pages/error/error.xhtml</location>

                </error-page>

             

            PS:

            The above lines in web.xml worked with JBoss 7.1.1 final.

            • 3. Re: ClassNotFoundException
              Tomaz Cerar Master

              I would say that AS7.x was wrong then.

               

              if you look at xsd and/or specification for this element, you will see that it expects fullly qualified class name.

               

              in your case it should be

              <error-page>

                     <exception-type>java.lang.Exception</exception-type>  

                     <location>/faces/pages/error/error.xhtml</location>

              </error-page>