6 Replies Latest reply on Oct 25, 2006 11:01 AM by vignesh76

    java.lang.NoClassDefFoundError: org/jboss/cache/CacheExcepti

    vignesh76

      I'm getting the above exception while web application deployment in 4.0.4GA in the default server configuration. It never occured in 4.0.3SP1. We don't need any clustering enabled (hence running the default server config) and want to get rid of this exception during deployment. The more detailed stack trace is as below


      15:49:08,214 INFO [JBossCacheManager] init(): replicationGranularity_ is 0 and invaldateSessionPolicy is 2
      15:49:08,231 ERROR [JBossCacheManager] JBossCacheService to Tomcat clustering not found
      java.lang.NoClassDefFoundError: org/jboss/cache/CacheException
       at org.jboss.web.tomcat.tc5.session.JBossCacheManager.init(JBossCacheManager.java:144)
       at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeployInternal(TomcatDeployer.java:332)
       at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeploy(TomcatDeployer.java:103)
       at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:371)
       at org.jboss.web.WebModule.startModule(WebModule.java:83)
       at org.jboss.web.WebModule.startService(WebModule.java:61)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
       at sun.reflect.GeneratedMethodAccessor2.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)
      
      
      


        • 1. Re: java.lang.NoClassDefFoundError: org/jboss/cache/CacheExc
          vignesh76

          I can get rid of the class not found exception by copying jboss-cache.jar from all/lib into default/lib, but I still get an exception as follows

          16:18:58,325 INFO [JBossCacheManager] init(): replicationGranularity_ is 0 and invaldateSessionPolicy is 2
          16:18:58,353 ERROR [JBossCacheService] jboss.cache:service=TomcatClusteringCache service to Tomcat clustering not found
          16:18:58,364 ERROR [JBossCacheManager] JBossCacheService to Tomcat clustering not found
          org.jboss.web.tomcat.tc5.session.ClusteringNotSupportedException: jboss.cache:service=TomcatClusteringCache service to Tomcat clustering not found
           at org.jboss.web.tomcat.tc5.session.JBossCacheService.<init>(JBossCacheService.java:127)
           at org.jboss.web.tomcat.tc5.session.JBossCacheManager.init(JBossCacheManager.java:144)
           at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeployInternal(TomcatDeployer.java:332)
           at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeploy(TomcatDeployer.java:103)
           at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:371)
           at org.jboss.web.WebModule.startModule(WebModule.java:83)
           at org.jboss.web.WebModule.startService(WebModule.java:61)
           at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
           at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
           at sun.reflect.GeneratedMethodAccessor2.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)
          


          In the first place why is clustering service being started in default server configuration which should not be the case? Of course jboss.cache:service=TomcatClusteringCache will not be found in the default server configuration. Is anyone else facing the same problem? How to get this disabled?

          • 2. Re: java.lang.NoClassDefFoundError: org/jboss/cache/CacheExc
            vignesh76

            Actually I can see the error in 4.0.3SP1 also but the stack trace of this error is suppressed in 4.0.3. I could locate the differences in the source code of the two versions as follows.

            4.0.3SP1, TomcatDeployer.java

            catch (ClusteringNotSupportedException e)
             {
             log.error("Failed to setup clustering, clustering disabled");
             }


            4.0.4GA, TomcatDeployer.java

            catch (ClusteringNotSupportedException e)
             {
             log.error("Failed to setup clustering, clustering disabled. Exception: ", e);
             }
             catch(Throwable t)
             {
             log.error("Failed to setup clustering, clustering disabled. Exception: ", t);
             }


            I guess the stack trace could be suppressed as it was in 4.0.3 for a smooth startup and prevent confusion.

            • 3. Re: java.lang.NoClassDefFoundError: org/jboss/cache/CacheExc

              I have the same problem also.

              I also suggest to suppress it or change the log level to a lower one.

              • 4. Re: java.lang.NoClassDefFoundError: org/jboss/cache/CacheExc

                You get this error because the web.xml contains a element which makes the tomcat deployer try to initiate the clustering. If that fails, it will fall back to standard, but it will also log the error + stacktrace.

                • 5. Re: java.lang.NoClassDefFoundError: org/jboss/cache/CacheExc

                  the web.xml contains a < distributable > element....

                  • 6. Re: java.lang.NoClassDefFoundError: org/jboss/cache/CacheExc
                    vignesh76

                    That's right. It was due to distributable. I had figured it out. Thanks.