3 Replies Latest reply: Jul 5, 2011 10:20 AM by chethan kumar RSS

    class not found exception .

    chethan kumar Newbie

      HI ,

            I am very fresh to the jboss6 and maveen ,

                To work on maveen i did some small maveen application it look like  as shown below,

                    

      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

        <modelVersion>4.0.0</modelVersion>

       

        <groupId>org.maveen.example</groupId>

        <artifactId>TestImplementation</artifactId>

        <version>0.0.1-SNAPSHOT</version>

        <packaging>war</packaging>

       

        <name>TestImplementation</name>

        <url>http://maven.apache.org</url>

       

        <properties>

          <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        </properties>

       

        <dependencies>

          <dependency>

            <groupId>junit</groupId>

            <artifactId>junit</artifactId>

            <version>3.8.1</version>

            <scope>test</scope>

          </dependency>

          <dependency>

          <groupId>javax.servlet</groupId>

          <artifactId>servlet-api</artifactId>

      <version>2.5</version>

          </dependency>

       

       

        </dependencies>

        <build>

        <directory>D:\jboss-6.0.0.Final\server\default\deploy</directory>

        </build>

       

      </project>

       

       

       

      Than  i create two java file( one servlet and one simple java file ) in src\main\java\org\maveen\example\TestImplementation

      my web.xml will look like this

       

      <?xml version="1.0" encoding="UTF-8" ?>

       

      - <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">

       

       

      <display-name>TestImplementation</display-name>

       

       

      - <servlet>

       

       

      <description />

       

       

      <display-name>TestSessionServlet</display-name>

       

       

      <servlet-name>TestSessionServlet</servlet-name>

       

       

      <servlet-class>TestSessionServlet</servlet-class>

       

      </servlet>

       

       

      - <servlet-mapping>

       

       

      <servlet-name>TestSessionServlet</servlet-name>

       

       

      <url-pattern>/TestSessionServlet</url-pattern>

       

      </servlet-mapping>

       

      </web-app>

       

       

         but during deploy it showing the exception as shown below ,

      DEPLOYMENTS IN ERROR:

        Deployment "vfs:///D:/jboss-6.0.0.Final/server/default/deploy/TestImplementation-0.0.1-SNAPSHOT.war" is in error due to the following reason(s): java.lang.ClassNotFoundException: TestSessionServlet from BaseClassLoader@c3b003{vfs:///D:/jboss-6.0.0.Final/server/default/deploy/TestImplementation-0.0.1-SNAPSHOT.war}

       

          at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1370) [:2.2.0.GA]

          at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1316) [:2.2.0.GA]

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

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

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

          at org.jboss.profileservice.deployment.hotdeploy.HDScanner$HDScanAction.deploy(HDScanner.java:246) [:0.2.2]

          at org.jboss.profileservice.deployment.hotdeploy.HDScanner$HDScanAction.complete(HDScanner.java:192) [:0.2.2]

          at org.jboss.profileservice.management.TwoPCActionWrapper.doComplete(TwoPCActionWrapper.java:57) [:0.2.2]

          at org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.complete(AbstractTwoPhaseModificationAction.java:74) [:0.2.2]

          at org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.prepare(AbstractTwoPhaseModificationAction.java:95) [:0.2.2]

          at org.jboss.profileservice.management.ModificationSession.prepare(ModificationSession.java:87) [:0.2.2]

          at org.jboss.profileservice.management.AbstractActionController.internalPerfom(AbstractActionController.java:234) [:0.2.2]

          at org.jboss.profileservice.management.AbstractActionController.performWrite(AbstractActionController.java:213) [:0.2.2]

          at org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:150) [:0.2.2]

          at org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:135) [:0.2.2]

          at org.jboss.profileservice.deployment.hotdeploy.HDScanner.scan(HDScanner.java:146) [:0.2.2]

          at org.jboss.profileservice.deployment.hotdeploy.HDScanner.run(HDScanner.java:90) [:0.2.2]

          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [:1.6.0_10]

          at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) [:1.6.0_10]

          at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) [:1.6.0_10]

          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) [:1.6.0_10]

          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181) [:1.6.0_10]

          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205) [:1.6.0_10]

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_10]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_10]

          at java.lang.Thread.run(Thread.java:619) [:1.6.0_10]

       

       

       

       

           any help will going to be appreciated , thanks in advance .

       

          Thanks and Regards ,

           Chethan kumar.c

       


        • 1. Re: class not found exception .
          chethan kumar Newbie

          My deployed jar look like this ,

           

          TestImplementation-0.0.1-SNAPSHOT.war

                              |

                              |____________META-INF

                              |

                              |____________WEB-INF

                                                            |

                                                            |____classes------------->org------->maveen---->example------->TestImplementation-------->Counter.class

                                                            |                                                                                            |

                                                            |____lib----servlet-api-2.5                                                          |------------->TestSessionServlet.class

                                                            |

                                                            |____web.xml

           

           

          - TestImplementation-0.0.1-SNAPSHOT.war contain META-INF and WEB-INF ,

          - WEB-INF contain classes ,lib,web.xml,

          - classess contain folder /org/maveen/example/TestImplementation under TestImplementation counter.class and TestSessionServlet.class

          • 2. Re: class not found exception .
            Paul Gier Master

            You should remove this part from your POM

              <build>

                <directory>D:\jboss-6.0.0.Final\server\default\deploy</directory>

              </build>

            Just build the war in the default directory, and then copy the war from the target directory to the jboss deploy directory after it is built.

            • 3. Re: class not found exception .
              chethan kumar Newbie

              Thanks Paul ,

               

              i solved my issues ,the probles was in web.xml file .

               

              the new problem is in jboss , when i run jboss without any war or ear file it throw some error as shown below,

               

              DEPLOYMENTS MISSING DEPENDENCIES:

                Deployment "JBossWSConsoleActivator" is missing the following dependencies:

                  Dependency "WebServer" (should be in state "Installed", but is actually in state "**ERROR**")

               

               

              Thanks and Regards ,

              Chethan kumar .c