7 Replies Latest reply on Jul 29, 2003 3:01 PM by madjack

    NoClassDefFoundError when starting JBoss

    318touring

      Hi all, pls help. I've been trying to get JBoss running on my PC. I have tried using the j2ee.jar file from my j2eesdk but to no avail. So now I put jboss own j2ee.jar file in my CLASSPATH. Anyone else has this problem?

      OS: Win 2000
      JBoss: jboss-3.0.6_tomcat-4.1.18

      But all I got was this (only part):
      22:42:26,405 INFO [MainDeployer] Starting deployment of package: file:/C:/jboss
      -3.0.6_tomcat-4.1.18/server/default/deploy/tomcat41-service.xml
      22:42:26,565 ERROR [MainDeployer] could not create deployment: file:/C:/jboss-3.
      0.6_tomcat-4.1.18/server/default/deploy/tomcat41-service.xml
      org.jboss.deployment.DeploymentException: instantiating org.jboss.web.catalina.E
      mbeddedCatalinaService41 failed: java.lang.NoClassDefFoundError: javax/servlet/S
      ervletContext; - nested throwable: (RuntimeErrorException: instantiating org.jbo
      ss.web.catalina.EmbeddedCatalinaService41 failed: java.lang.NoClassDefFoundError
      : javax/servlet/ServletContext
      Cause: java.lang.NoClassDefFoundError: javax/servlet/ServletContext)

      My settings are:
      CLASSPATH=C:\j2sdk1.4.0_01\lib;C:\jboss-3.0.6_tomcat-4.1.18\server\default\lib\j
      boss-j2ee.jar
      J2EE_HOME=C:\win2k\j2sdkee1.3
      JAVA_HOME=C:\j2sdk1.4.0_01
      JBOSS_HOME=C:\jboss-3.0.6_tomcat-4.1.18
      PATH=C:\Program Files\Microsoft.NET\FrameworkSDK\Bin\;C:\Program Files\Microsoft
      Visual Studio .NET\Common7\IDE\;C:\WINNT\Microsoft.NET\Framework\v1.0.3705\;C:\
      Program Files\Microsoft Visual Studio .NET\Vc7\bin\;c:\win2k\mssql7\BINN;C:\PROG
      RA~1\mtg01\WinNT958;C:\j2sdk1.4.0_01\bin;C:\win2k\j2sdkee1.3\lib

        • 1. Re: NoClassDefFoundError when starting JBoss
          esac

          Hi everyone!
          I have the same problem. But it's with Linux(Red Hat 9.0), and it's ok with Windows 2000.

          JBoss: jboss-3.0.6_tomcat-4.1.18

          The settings:
          CLASSPATH=".:/usr/java/j2sdk1.4.1_03/lib:/usr/java/j2sdk1.4.1_03/lib/dt.jar:/usr/java/j2sdk1.4.1_03/lib/tools.jar:/usr/java/j2sdk1.4.1_03/jre/lib:/usr/j2ee/j2sdkee1.3.1/lib/j2ee.jar"
          J2EE_HOME="/usr/j2ee/j2sdkee1.3.1"
          JAVA_HOME="/usr/java/j2sdk1.4.1_03"
          JBOSS_HOME="/usr/JBoss/jboss-3.0.6_tomcat-4.1.18"
          TOMCAT_HOME="/usr/JBoss/jboss-3.0.6_tomcat-4.1.18/tomcat-4.1.x"

          The output is the same:
          22:42:26,405 INFO [MainDeployer] Starting deployment of package: file:/C:/jboss
          -3.0.6_tomcat-4.1.18/server/default/deploy/tomcat41-service.xml
          22:42:26,565 ERROR [MainDeployer] could not create deployment: file:/C:/jboss-3.
          0.6_tomcat-4.1.18/server/default/deploy/tomcat41-service.xml
          org.jboss.deployment.DeploymentException: instantiating org.jboss.web.catalina.E
          mbeddedCatalinaService41 failed: java.lang.NoClassDefFoundError: javax/servlet/S
          ervletContext; - nested throwable: (RuntimeErrorException: instantiating org.jbo
          ss.web.catalina.EmbeddedCatalinaService41 failed: java.lang.NoClassDefFoundError
          : javax/servlet/ServletContext
          Cause: java.lang.NoClassDefFoundError: javax/servlet/ServletContext)

          Help me, please. Thanks in advance.

          Regards,
          esac

          • 2. Re: NoClassDefFoundError when starting JBoss
            jonlee

            Most likely you are upsetting JBoss with the extra definitions in the classpath. JBoss provides it's own J2EE libraries, which you are probably pre-empting by specifying other definitions. See this thread:
            http://www.jboss.org/modules/bb/index.html?module=bb&op=viewtopic&t=

            • 3. Re: NoClassDefFoundError when starting JBoss
              esac

              Thanks. But it seems not to be that problem.

              now my output:
              ================================================================================

              JBoss Bootstrap Environment

              JBOSS_HOME: /usr/JBoss/jboss-3.0.6_tomcat-4.1.18

              JAVA: /usr/java/j2sdk1.4.1_03/bin/java

              JAVA_OPTS: -server -Dprogram.name=run.sh

              CLASSPATH: /usr/JBoss/jboss-3.0.6_tomcat-4.1.18/bin/run.jar:/usr/java/j2sdk1.4.1_03/lib/tools.jar

              ================================================================================

              08:31:57,804 INFO [Server] JBoss Release: JBoss-3.0.6 CVSTag=JBoss_3_0_6
              08:31:57,848 INFO [Server] Home Dir: /usr/JBoss/jboss-3.0.6_tomcat-4.1.18
              08:31:57,849 INFO [Server] Home URL: file:/usr/JBoss/jboss-3.0.6_tomcat-4.1.18/
              08:31:57,850 INFO [Server] Library URL: file:/usr/JBoss/jboss-3.0.6_tomcat-4.1.18/lib/
              08:31:57,854 INFO [Server] Patch URL: null
              08:31:57,855 INFO [Server] Server Name: default
              08:31:57,856 INFO [Server] Server Home Dir: /usr/JBoss/jboss-3.0.6_tomcat-4.1.18/server/default
              08:31:57,857 INFO [Server] Server Home URL: file:/usr/JBoss/jboss-3.0.6_tomcat-4.1.18/server/default/
              08:31:57,858 INFO [Server] Server Data Dir: /usr/JBoss/jboss-3.0.6_tomcat-4.1.18/server/default/db
              08:31:57,859 INFO [Server] Server Temp Dir: /usr/JBoss/jboss-3.0.6_tomcat-4.1.18/server/default/tmp
              08:31:57,860 INFO [Server] Server Config URL: file:/usr/JBoss/jboss-3.0.6_tomcat-4.1.18/server/default/conf/
              08:31:57,861 INFO [Server] Server Library URL: file:/usr/JBoss/jboss-3.0.6_tomcat-4.1.18/server/default/lib/
              08:31:57,862 INFO [Server] Root Deployemnt Filename: jboss-service.xml
              08:31:57,914 INFO [Server] Starting General Purpose Architecture (GPA)...
              08:31:59,030 INFO [ServerInfo] Java version: 1.4.1_03,Sun Microsystems Inc.
              08:31:59,031 INFO [ServerInfo] Java VM: Java HotSpot(TM) Server VM 1.4.1_03-b02,Sun Microsystems Inc.
              08:31:59,032 INFO [ServerInfo] OS-System: Linux 2.4.20-8,i386

              ...........

              to be continued...

              • 4. Re: NoClassDefFoundError when starting JBoss
                esac

                and the error is the same:

                08:32:26,005 ERROR [MainDeployer] could not create deployment: file:/usr/JBoss/jboss-3.0.6_tomcat-4.1.18/server/default/deploy/tomcat41-service.xml
                org.jboss.deployment.DeploymentException: instantiating org.jboss.web.catalina.EmbeddedCatalinaService41 failed: java.lang.NoClassDefFoundError: javax/servlet/ServletContext; - nested throwable: (RuntimeErrorException: instantiating org.jboss.web.catalina.EmbeddedCatalinaService41 failed: java.lang.NoClassDefFoundError: javax/servlet/ServletContext
                Cause: java.lang.NoClassDefFoundError: javax/servlet/ServletContext)
                at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:153)
                at org.jboss.system.ServiceController.install(ServiceController.java:231)
                at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:324)
                at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
                at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
                at $Proxy2.install(Unknown Source)

                ........


                I am confused that even it is wrong, why is javax/servlet/ServletContext, not javax.servlet.ServletContext?

                Please help me. Thanks very much!

                Regards,
                esac

                • 5. Re: NoClassDefFoundError when starting JBoss
                  esac

                  My god! It seems to be a bug.

                  #$JBOSS_HOME/bin/run.sh
                  cant' work correct!
                  And I have to switch to the dir then run it:
                  #cd $JBOSS_HOME/bin
                  # ./run.sh

                  • 6. Re: NoClassDefFoundError when starting JBoss
                    stefano_fornari

                    I have the same problem with JBoss 3.0.8/tomcat on Linux RedHat 8.0.

                    Has anyone fixed the script?

                    Thanks in advance.

                    Stefano

                    • 7. Re: NoClassDefFoundError when starting JBoss

                      Hi,

                      I'm using JBoss with Windows, I have always this problem when I'm just installing this software. You just have to put the point in your classpath. For example :

                      SET CLASSPATH = .;c:\jsdk\lib\rt.jar

                      The "." is important. It is used to find your classes in the current directory.

                      I hope this helpful.