5 Replies Latest reply on Mar 4, 2012 8:18 PM by Wen Cheng

    JBOSS6, ClassNotFoundException

    Wen Cheng Newbie

      Hello, all.

       

      This morning, I packed a .war file. The content of the file is as follows:

       

      • WEB-INF
        • web.xml
      • com
        • mytest
          • ServerInfo.class
          • ProcessorAutoStartListener.class

       

      The content of web.xml is:

       

      <?xml version="1.0" encoding="ISO-8859-1"?>
      <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
               "http://java.sun.com/dtd/web-app_2_3.dtd" >
      
      <web-app>
      
       <listener>
          <listener-class>com.mytest.ProcessorAutoStartListener</listener-class>
        </listener>
      
         <servlet>
            <servlet-name>ServerInfo</servlet-name>
            <servlet-class>com.mytest.ServerInfo</servlet-class>
          <load-on-startup>1</load-on-startup>
        </servlet>
      
        <servlet-mapping>
            <servlet-name>ServerInfo</servlet-name>
            <url-pattern>/ServerInfo</url-pattern>
        </servlet-mapping>
      
      </web-app>
      

       

      I named the file as "wb.war", and put it in "%JBOSS_HOME%/server/default/deploy", then I run jboss.

       

      I got the errors in server.log like:

       

       

      2011-07-26 09:40:37,367 ERROR [ProfileServiceBootstrap] (Thread-2) Failed to load profile:: org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
      
      DEPLOYMENTS IN ERROR:
        Deployment "vfs:///D:/JBOSS/jboss-6.0.0.Final/server/default/deploy/wb.war" is in error due to the following reason(s): 
            java.lang.ClassNotFoundException: com.mytest.ServerInfo from BaseClassLoader@178c581{vfs:///D:/JBOSS/jboss-6.0.0.Final/server/default/deploy/wb.war}
      
          at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1228) [:2.2.0.GA]
          at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:905) [:2.2.0.GA]
          at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.checkComplete(MainDeployerPlugin.java:87) [:6.0.0.Final]
          at org.jboss.profileservice.deployment.ProfileDeployerPluginRegistry.checkAllComplete(ProfileDeployerPluginRegistry.java:107) [:0.2.2]
          at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:135) [:6.0.0.Final]
          at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56) [:6.0.0.Final]
          at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]
          at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]
          at java.lang.Thread.run(Thread.java:662) [:1.6.0_23]
      
      2011-07-26 09:40:37,377 INFO  [org.apache.coyote.http11.Http11Protocol] (Thread-2) Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
      2011-07-26 09:40:37,397 INFO  [org.apache.coyote.ajp.AjpProtocol] (Thread-2) Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
      2011-07-26 09:40:37,407 INFO  [org.apache.coyote.http11.Http11Protocol] (Thread-2) Starting Coyote HTTP/1.1 on http-127.0.0.1-8443
      2011-07-26 09:40:37,407 INFO  [org.jboss.bootstrap.impl.base.server.AbstractServer] (Thread-2) JBossAS [6.0.0.Final "Neo"] Started in 26s:615ms
      

       

      And the detail info in boot.log:

       

      09:40:25,819 ERROR [AbstractKernelController] Error installing to PreReal: 
           name=vfs:///D:/JBOSS/jboss-6.0.0.Final/server/default/deploy/wb.war state=PostClassLoader mode=Manual requiredState=PreReal: 
               org.jboss.deployers.spi.DeploymentException: 
               java.lang.ClassNotFoundException: com.mytest.ServerInfo from BaseClassLoader@178c581{vfs:///D:/JBOSS/jboss-6.0.0.Final/server/default/deploy/wb.war}
          at org.jboss.resteasy.integration.deployers.ResteasyScannerDeployer.checkDeclaredApplicationClassAsServlet(ResteasyScannerDeployer.java:257) [:6.0.0.Final]
          at org.jboss.resteasy.integration.deployers.ResteasyScannerDeployer.scan(ResteasyScannerDeployer.java:108) [:6.0.0.Final]
          at org.jboss.resteasy.integration.deployers.ResteasyScannerDeployer.internalDeploy(ResteasyScannerDeployer.java:64) [:6.0.0.Final]
          at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:55) [:2.2.0.GA]
          at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179) [:2.2.0.GA]
          at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1832) [:2.2.0.GA]
          at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1550) [:2.2.0.GA]
          at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1491) [:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.deployers.plugins.deployers.DeployersImpl.change(DeployersImpl.java:1983) [:2.2.0.GA]
          at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:1076) [:2.2.0.GA]
          at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679) [:2.2.0.GA]
          at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.process(MainDeployerPlugin.java:106) [:6.0.0.Final]
          at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.process(ProfileControllerContext.java:143) [:0.2.2]
          at org.jboss.profileservice.dependency.ProfileDeployAction.deploy(ProfileDeployAction.java:151) [:0.2.2]
          at org.jboss.profileservice.dependency.ProfileDeployAction.installActionInternal(ProfileDeployAction.java:94) [:0.2.2]
          at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54) [jboss-kernel.jar:2.2.0.GA]
          at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42) [jboss-kernel.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.GA]
          at org.jboss.profileservice.dependency.ProfileActivationWrapper$BasicProfileActivation.start(ProfileActivationWrapper.java:190) [:0.2.2]
          at org.jboss.profileservice.dependency.ProfileActivationWrapper.start(ProfileActivationWrapper.java:87) [:0.2.2]
          at org.jboss.profileservice.dependency.ProfileActivationService.activateProfile(ProfileActivationService.java:215) [:0.2.2]
          at org.jboss.profileservice.dependency.ProfileActivationService.activate(ProfileActivationService.java:159) [:0.2.2]
          at org.jboss.profileservice.bootstrap.AbstractProfileServiceBootstrap.activate(AbstractProfileServiceBootstrap.java:112) [:0.2.2]
          at org.jboss.profileservice.resolver.BasicResolverFactory$ProfileResolverFacade.deploy(BasicResolverFactory.java:87) [:0.2.2]
          at org.jboss.profileservice.bootstrap.AbstractProfileServiceBootstrap.start(AbstractProfileServiceBootstrap.java:91) [:0.2.2]
          at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:132) [:6.0.0.Final]
          at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56) [:6.0.0.Final]
          at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]
          at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]
          at java.lang.Thread.run(Thread.java:662) [:1.6.0_23]
      Caused by: java.lang.ClassNotFoundException: com.mytest.ServerInfo from BaseClassLoader@178c581{vfs:///D:/JBOSS/jboss-6.0.0.Final/server/default/deploy/wb.war}
          at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:480) [jboss-classloader.jar:2.2.0.GA]
          at java.lang.ClassLoader.loadClass(ClassLoader.java:248) [:1.6.0_23]
          at org.jboss.resteasy.integration.deployers.ResteasyScannerDeployer.checkDeclaredApplicationClassAsServlet(ResteasyScannerDeployer.java:253) [:6.0.0.Final]
          ... 47 more
      

       

      I am not sure what's wrong with it.

      The log said the class "com.mytest.ServerInfo" can not be found, but it is exactly there.

       

      Any suggestion?

        • 1. Re: JBOSS6, ClassNotFoundException
          jaikiran pai Master

          The classes should be in .war/WEB-INF/classes folder.

          • 2. Re: JBOSS6, ClassNotFoundException
            adoshi Newbie

            Jaikiran,

             

            Can you elaborate on your answer, i have a similar issue and am not able to figure it out and it has been a while for me now.

            • 3. Re: JBOSS6, ClassNotFoundException
              Wen Cheng Newbie

              The content of  .war file should not be like this:

               

              • WEB-INF
                • web.xml
              • com
                • mytest
                  • ServerInfo.class
                  • ProcessorAutoStartListener.class

               

              It should be like this:

               

              WEB-INF

                • web.xml
                • classes
                  • com
                    • mytest
                      • ServerInfo.class
                      • ProcessorAutoStartListener.class
              • 4. Re: JBOSS6, ClassNotFoundException
                adoshi Newbie

                Thank you Wen for explaining jaikiran's response, here is the exception that i am getting and am still not able to figure out the issue, thing is am trying to club icefaces with jboss and it is challenging stuff and i have not been able to figure it out.

                 

                 

                17:00:56,947 WARNING [AsynchronousFileImpl] You have a native library with a different version than expected

                17:01:05,959 INFO  [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@31568103{vfs:///env/dev8/jboss-server/server/all/deploy/kr.ear/kr-ejbs.jar/}

                17:01:05,960 INFO  [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@31568103{vfs:///env/dev8/jboss-server/server/all/deploy/kr.ear/kr-ejbs.jar/}

                17:01:05,960 INFO  [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@31568103{vfs:///env/dev8/jboss-server/server/all/deploy/kr.ear/kr-ejbs.jar/}

                17:01:05,961 ERROR [AbstractKernelController] Error installing to PreReal: name=vfs:///env/dev8/jboss-server/server/all/deploy/kr.ear state=PostClassLoader mode=Manual requiredState=PreReal: org.jboss.deployers.spi.DeploymentException: java.lang.ClassNotFoundException: com.icesoft.faces.webapp.CompatResourceServlet from BaseClassLoader@ab12f1{vfs:///env/dev8/jboss-server/server/all/deploy/kr.ear/kr.war/}

                        at org.jboss.resteasy.integration.deployers.ResteasyScannerDeployer.checkDeclaredApplicationClassAsServlet(ResteasyScannerDeployer.java:257) [:6.0.0.Final]

                        at org.jboss.resteasy.integration.deployers.ResteasyScannerDeployer.scan(ResteasyScannerDeployer.java:108) [:6.0.0.Final]

                        at org.jboss.resteasy.integration.deployers.ResteasyScannerDeployer.internalDeploy(ResteasyScannerDeployer.java:64) [:6.0.0.Final]

                        at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:55) [:2.2.0.GA]

                        at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179) [:2.2.0.GA]

                        at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1832) [:2.2.0.GA]

                        at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1550) [:2.2.0.GA]

                        at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1603) [:2.2.0.GA]

                        at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1491) [:2.2.0.GA]

                        at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.GA]

                        at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.GA]

                        at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.GA]

                        at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.GA]

                        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.GA]

                        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.GA]

                        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.GA]

                        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.GA]

                        at org.jboss.deployers.plugins.deployers.DeployersImpl.change(DeployersImpl.java:1983) [:2.2.0.GA]

                        at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:1076) [:2.2.0.GA]

                        at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679) [:2.2.0.GA]

                        at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.process(MainDeployerPlugin.java:106) [:6.0.0.Final]

                        at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.process(ProfileControllerContext.java:143) [:0.2.2]

                        at org.jboss.profileservice.dependency.ProfileDeployAction.deploy(ProfileDeployAction.java:151) [:0.2.2]

                        at org.jboss.profileservice.dependency.ProfileDeployAction.installActionInternal(ProfileDeployAction.java:94) [:0.2.2]

                        at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54) [jboss-kernel.jar:2.2.0.GA]

                        at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42) [jboss-kernel.jar:2.2.0.GA]

                        at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) [jboss-dependency.jar:2.2.0.GA]

                        at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) [jboss-dependency.jar:2.2.0.GA]

                        at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) [jboss-dependency.jar:2.2.0.GA]

                        at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.GA]

                 

                Any suggestions would be really helpful as i have spend lot of time on this without any success.

                • 5. Re: JBOSS6, ClassNotFoundException
                  Wen Cheng Newbie

                  Hello Ados.

                  I didn't use a .ear file to deploy my project. I just put my .war folder and test-ejb.jar in %jboss_home%/server/default/deploy/. and finally it works.

                  In my problem, the exception is because I put the files in wrong places.

                  If I were you, I will check the examples that jboss already providered (if  there are examples exist) to see if I put all the files in the right places.