8 Replies Latest reply on Sep 19, 2008 11:40 AM by Peter Johnson

    java.lang.NoClassDefFoundError exception when starting 4.2.3

    bob witt Newbie

      Hello,

      Could someone please tell me why I am getting a slew of java.lang.NoClassDefFoundError exceptions such as the following when I start JBoss on my Mac.

      Thank you for your time.

      Bobs-iMac:bin bob$ ./run.sh
      ./run.sh: line 89: ulimit: open files: cannot modify limit: Invalid argument
      run.sh: Could not set maximum file descriptor limit: unlimited
      =========================================================================

      JBoss Bootstrap Environment

      JBOSS_HOME: /Development/jboss-4.2.3.GA

      JAVA: /Library/Java/Home/bin/java

      JAVA_OPTS: -Dprogram.name=run.sh -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000

      CLASSPATH: /Development/jboss-4.2.3.GA/bin/run.jar

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

      14:01:52,567 INFO [Server] Starting JBoss (MX MicroKernel)...
      14:01:52,568 INFO [Server] Release ID: JBoss [Trinity] 4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181439)
      14:01:52,574 INFO [Server] Home Dir: /Development/jboss-4.2.3.GA
      14:01:52,574 INFO [Server] Home URL: file:/Development/jboss-4.2.3.GA/
      14:01:52,575 INFO [Server] Patch URL: null
      14:01:52,575 INFO [Server] Server Name: default
      14:01:52,576 INFO [Server] Server Home Dir: /Development/jboss-4.2.3.GA/server/default
      14:01:52,576 INFO [Server] Server Home URL: file:/Development/jboss-4.2.3.GA/server/default/
      14:01:52,576 INFO [Server] Server Log Dir: /Development/jboss-4.2.3.GA/server/default/log
      14:01:52,576 INFO [Server] Server Temp Dir: /Development/jboss-4.2.3.GA/server/default/tmp
      14:01:52,577 INFO [Server] Root Deployment Filename: jboss-service.xml
      14:01:52,866 INFO [ServerInfo] Java version: 1.5.0_13,Apple Inc.
      14:01:52,866 INFO [ServerInfo] Java VM: Java HotSpot(TM) Client VM 1.5.0_13-119,Apple Inc.
      14:01:52,867 INFO [ServerInfo] OS-System: Mac OS X 10.5.4,i386
      14:01:53,231 INFO [Server] Core system initialized
      14:01:55,660 INFO [WebService] Using RMI server codebase: http://127.0.0.1:8083/
      14:01:55,662 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resource:jboss-log4j.xml
      14:01:56,192 INFO [TransactionManagerService] JBossTS Transaction Service (JTA version) - JBoss Inc.
      14:01:56,192 INFO [TransactionManagerService] Setting up property manager MBean and JMX layer
      14:01:56,362 INFO [TransactionManagerService] Starting recovery manager
      14:01:56,450 INFO [TransactionManagerService] Recovery manager started
      14:01:56,450 INFO [TransactionManagerService] Binding TransactionManager JNDI Reference
      14:01:59,026 INFO [EJB3Deployer] Starting java:comp multiplexer
      14:01:59,675 ERROR [MainDeployer] Could not initialise deployment: file:/Development/jboss-4.2.3.GA/server/default/deploy/jbossws.sar/
      java.lang.NoClassDefFoundError: javax/ejb/Stateless
      at org.jboss.ejb3.EJB3Util.isStateless(EJB3Util.java:42)
      at org.jboss.ejb3.EJB3Deployer.hasEjbAnnotation(EJB3Deployer.java:219)
      at org.jboss.ejb3.EJB3Deployer.accepts(EJB3Deployer.java:271)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy34.accepts(Unknown Source)
      at org.jboss.deployment.MainDeployer.findDeployer(MainDeployer.java:1078)
      at org.jboss.deployment.MainDeployer.init(MainDeployer.java:857)
      at org.jboss.deployment.MainDeployer.init(MainDeployer.java:895)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:809)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy9.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
      at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:417)
      at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy4.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:304)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy5.deploy(Unknown Source)
      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
      at org.jboss.Main.boot(Main.java:200)
      at org.jboss.Main$1.run(Main.java:508)
      at java.lang.Thread.run(Thread.java:613)
      14:02:00,470 INFO [Embedded] Catalina naming disabled
      14:02:00,647 INFO [AprLifecycleListener] The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: .:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java...

        • 1. Re: java.lang.NoClassDefFoundError exception when starting 4
          jaikiran pai Master

           

          14:01:59,675 ERROR [MainDeployer] Could not initialise deployment: file:/Development/jboss-4.2.3.GA/server/default/deploy/jbossws.sar/
          java.lang.NoClassDefFoundError: javax/ejb/Stateless


          I wouldn't expect the deployment to fail with a NoClassDefFoundError for this class. Is this a clean installation of JBoss? Did you do any changes after downloading JBoss? If not, then maybe the downloaded file was corrupt. Try downloading JBoss again.

          • 2. Re: java.lang.NoClassDefFoundError exception when starting 4
            erasmo2 marciano2 Master

            Try as suggested jaikiran.

            If your Jboss starting with error you check host file.


            • 3. Re: java.lang.NoClassDefFoundError exception when starting 4
              Gabriel Reis Newbie

              I'm having the same problem but it happens when I try to start jboss over ssh execution. Something like this:

              ssh localhost "/opt/jboss/bin/run.sh start"


              If I start it in the local machine it works fine, but if I start it remotely, the same stacktrace appears.

              Any idea?

              • 5. Re: java.lang.NoClassDefFoundError exception when starting 4
                Gabriel Reis Newbie

                You're right. The start parameter is unnecessary but doesn't affect the behavior. I think I found the problem. The script doesn't use the JAVA_HOME that I set on the /etc/profile. Now it is working with this:

                ssh localhost "export JAVA_HOME=/opt/jdk1.6 && /opt/jboss/bin/run.sh"

                • 6. Re: java.lang.NoClassDefFoundError exception when starting 4
                  Vijay Gangoni Newbie

                  Hi,

                  I have downloaded the latest version jboss Application server (jboss-4.2.3.GA-jdk6.zip) and unzipped.

                  But when I start the server I see many errors stack trace on the server console, specified below.


                  C:\>DevEnv\jboss-4.2.3.GA1\bin\run.bat -c all
                  ===============================================================================

                  JBoss Bootstrap Environment

                  JBOSS_HOME: C:\DevEnv\jboss-4.2.3.GA1

                  JAVA: C:\Java\jdk1.5.0_16\bin\java

                  JAVA_OPTS: -Dprogram.name=run.bat -server -Xms128m -Xmx512m -Dsun.rmi.dgc.cli
                  ent.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000

                  CLASSPATH: C:\Java\jdk1.5.0_16\lib\tools.jar;C:\DevEnv\jboss-4.2.3.GA1\bin\run
                  .jar

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

                  12:07:42,609 INFO [Server] Starting JBoss (MX MicroKernel)...
                  12:07:42,609 INFO [Server] Release ID: JBoss [Trinity] 4.2.3.GA (build: SVNTag=
                  JBoss_4_2_3_GA date=200807181439)
                  12:07:42,609 INFO [Server] Home Dir: C:\DevEnv\jboss-4.2.3.GA1
                  12:07:42,609 INFO [Server] Home URL: file:/C:/DevEnv/jboss-4.2.3.GA1/
                  12:07:42,609 INFO [Server] Patch URL: null
                  12:07:42,609 INFO [Server] Server Name: all
                  12:07:42,609 INFO [Server] Server Home Dir: C:\DevEnv\jboss-4.2.3.GA1\server\al
                  l
                  12:07:42,609 INFO [Server] Server Home URL: file:/C:/DevEnv/jboss-4.2.3.GA1/ser
                  ver/all/
                  12:07:42,609 INFO [Server] Server Log Dir: C:\DevEnv\jboss-4.2.3.GA1\server\all
                  \log
                  12:07:42,609 INFO [Server] Server Temp Dir: C:\DevEnv\jboss-4.2.3.GA1\server\al
                  l\tmp
                  12:07:42,609 INFO [Server] Root Deployment Filename: jboss-service.xml
                  12:07:43,171 INFO [ServerInfo] Java version: 1.5.0_16,Sun Microsystems Inc.
                  12:07:43,171 INFO [ServerInfo] Java VM: Java HotSpot(TM) Server VM 1.5.0_16-b02
                  ,Sun Microsystems Inc.
                  12:07:43,171 INFO [ServerInfo] OS-System: Windows XP 5.1,x86
                  12:07:44,500 INFO [Server] Core system initialized
                  12:07:50,125 INFO [WebService] Using RMI server codebase: http://127.0.0.1:8083
                  /
                  12:07:50,125 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resour
                  ce:jboss-log4j.xml
                  12:07:51,093 INFO [TransactionManagerService] JBossTS Transaction Service (JTA
                  version) - JBoss Inc.
                  12:07:51,093 INFO [TransactionManagerService] Setting up property manager MBean
                  and JMX layer
                  12:07:51,531 INFO [TransactionManagerService] Starting recovery manager
                  12:07:51,703 INFO [TransactionManagerService] Recovery manager started
                  12:07:51,703 INFO [TransactionManagerService] Binding TransactionManager JNDI R
                  eference
                  12:07:58,687 INFO [EJB3Deployer] Starting java:comp multiplexer
                  12:08:01,578 INFO [STDOUT]
                  -------------------------------------------------------
                  GMS: address is 127.0.0.1:4166
                  -------------------------------------------------------
                  12:08:03,609 INFO [TreeCache] viewAccepted(): [127.0.0.1:4166|0] [127.0.0.1:416
                  6]
                  12:08:03,640 INFO [TreeCache] TreeCache local address is 127.0.0.1:4166
                  12:08:03,640 INFO [TreeCache] State could not be retrieved (we are the first me
                  mber in group)
                  12:08:03,640 INFO [TreeCache] parseConfig(): PojoCacheConfig is empty
                  12:08:04,828 ERROR [MainDeployer] Could not initialise deployment: file:/C:/DevE
                  nv/jboss-4.2.3.GA1/server/all/deploy/jbossws.sar/
                  java.lang.NoClassDefFoundError: javax/ejb/Stateless
                  at org.jboss.ejb3.EJB3Util.isStateless(EJB3Util.java:42)
                  at org.jboss.ejb3.EJB3Deployer.hasEjbAnnotation(EJB3Deployer.java:219)
                  at org.jboss.ejb3.EJB3Deployer.accepts(EJB3Deployer.java:271)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
                  java:39)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
                  sorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:585)
                  at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
                  er.java:155)



                  And once I try to access the URL http://localhost:8080/ I’m not getting any thing displayed. Even though I see this on the server console:

                  12:12:52,859 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8
                  080
                  12:12:52,937 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
                  12:12:52,953 INFO [Server] JBoss (MX MicroKernel) [4.2.3.GA (build: SVNTag=JBos
                  s_4_2_3_GA date=200807181439)] Started in 5m:10s:344ms


                  Can any one please help me out with a solution?

                  Many Thanks,
                  Vijay G

                  • 7. Re: java.lang.NoClassDefFoundError exception when starting 4
                    Vijay Gangoni Newbie

                    greis,

                    w.r.t your post; I as well check if it is using the correct Java_home by editing the run.bat file and echoing the JAVA_HOME, found no issues with that.

                    I Also edited run.bat, and changed:
                    set JAVA_OPTS=%JAVA_OPTS% -Xms128m -Xmx512m

                    to:

                    set JAVA_OPTS=%JAVA_OPTS% -Dhttp.proxyHost=10.1.162.14 -Xms128m -Xmx512m

                    But still it didn't work.

                    • 8. Re: java.lang.NoClassDefFoundError exception when starting 4
                      Peter Johnson Master

                      Look again at what you downloaded: jboss-4.2.3.GA-jdk6.zip

                      This download for 4.2.3 is targeted for JDK6. However, you are using JDK5:

                      12:07:43,171 INFO [ServerInfo] Java version: 1.5.0_16,Sun Microsystems Inc.
                      12:07:43,171 INFO [ServerInfo] Java VM: Java HotSpot(TM) Server VM 1.5.0_16-b02,Sun Microsystems Inc.

                      You need to either download the regular 4.2.3 zip file, or install and use JDK6.