9 Replies Latest reply on Oct 13, 2004 11:08 AM by umk

    TreeCache standalone, Tomcat 5.0.28, NoClassDefFoundError

    umk

      Hello,

      I'm trying to use TreeCacheAop/TreeCache functionality from within a
      web app deployed under Tomcat 5.0.28 (JDK1.4.2 and jbosscache 1.1
      with aop 1.0rc1). I'm using the aopc to compile necessary classes (and
      therefore not using org.jboss.aop.standalone.SystemClassLoader)

      This is the error I'm getting:

      java.lang.NoClassDefFoundError: org/jboss/aop/proxy/ClassProxy
       java.lang.ClassLoader.defineClass0(Native Method)
       java.lang.ClassLoader.defineClass(ClassLoader.java:537)
       java.lang.ClassLoader.defineClass(ClassLoader.java:448)
       javassist.ClassPool$SimpleLoader.loadClass(ClassPool.java:244)
       javassist.ClassPool.toClass(ClassPool.java:296)
       javassist.CtClass.toClass(CtClass.java:883)
       org.jboss.aop.proxy.ClassProxyFactory.generateProxy(ClassProxyFactory.java:139)
       org.jboss.aop.proxy.ClassProxyFactory.newInstance(ClassProxyFactory.java:53)
       org.jboss.cache.aop.CollectionInterceptorUtil.getMethodMap(CollectionInterceptorUtil.java:47)
       org.jboss.cache.aop.CachedMapInterceptor.<init>(CachedMapInterceptor.java:31)
       org.jboss.cache.aop.TreeCacheAop.getObject(TreeCacheAop.java:462)
       org.jboss.cache.aop.CacheInterceptor.invoke(CacheInterceptor.java:98)
       com.jcorporate.expresso.core.dbobj.NextNumberImpl$NextNumberImpl_contextMap_19963527_OptimizedGetFieldInvocation.invokeNext(NextNumberImpl$NextNumberImpl_contextMap_19963527_OptimizedGetFieldInvocation.java)
      


      ClassProxy is located in the jboss-aop.jar file and this file is in my
      WEB-INF/lib folder.

      So, my question is: How do I go about correctly
      integrating Tomcat and JBossCache so that required libraries are found
      properly?

      Big Thanks!

        • 1. Re: TreeCache standalone, Tomcat 5.0.28, NoClassDefFoundErro

          I will need to take a look myself to see why.

          -Ben

          • 2. Re: TreeCache standalone, Tomcat 5.0.28, NoClassDefFoundErro
            umk

             

            "bwang00" wrote:
            I will need to take a look myself to see why.

            -Ben


            Looking forward to hearing back! Please don't forget about me Ben :)

            • 3. Re: TreeCache standalone, Tomcat 5.0.28, NoClassDefFoundErro

              Ok, I won't. But give me couple more days though.

              -Ben

              • 4. Re: TreeCache standalone, Tomcat 5.0.28, NoClassDefFoundErro

                I have downloaded Tomcat and am ready to look at this problem. Do you happen to have an example that you can send me so I can see it myself?

                Please send it to ben.wang@jboss.com

                Thanks,

                -Ben

                • 5. Re: TreeCache standalone, Tomcat 5.0.28, NoClassDefFoundErro
                  umk

                   

                  "bwang00" wrote:
                  I have downloaded Tomcat and am ready to look at this problem. Do you happen to have an example that you can send me so I can see it myself?

                  Please send it to ben.wang@jboss.com

                  Thanks,

                  -Ben


                  I have put together a sample application that produces the error. Check your mail. Thanks.


                  • 6. Re: TreeCache standalone, Tomcat 5.0.28, NoClassDefFoundErro

                    I have tested your example and it worked for me!

                    I am also running Tomcat5.0.28 and JBossCache1.1. Before I ran your example, I copied the libraries from jboss-cache/lib to ROOT/WEB-INF/lib. E.g., jboss-*.jar, trove.jar, javassist.jar, etc.

                    After I ran index2.jsp, I can see the print out from the test() method. No error has been reported.

                    Can you make sure you have the right libraries copied?

                    -Ben

                    • 7. Re: TreeCache standalone, Tomcat 5.0.28, NoClassDefFoundErro
                      umk

                       

                      "bwang00" wrote:
                      I have tested your example and it worked for me!

                      I am also running Tomcat5.0.28 and JBossCache1.1. Before I ran your example, I copied the libraries from jboss-cache/lib to ROOT/WEB-INF/lib. E.g., jboss-*.jar, trove.jar, javassist.jar, etc.

                      After I ran index2.jsp, I can see the print out from the test() method. No error has been reported.

                      Can you make sure you have the right libraries copied?

                      -Ben


                      I started from the beginning to make sure I didn't mess up somewhere:
                      - Downloaded jakarta-tomcat-5.0.28.exe and JBossCache-1.1.zip
                      - Installed tomcat and copied all jars from jboss-cache/lib to ROOT/WEB-INF/lib
                      - Started tomcat and loaded index2.jsp

                      Same error!

                      What version of the JRE are you using? I'm runing build 1.4.2-b28

                      Any other suggestions?

                      • 8. Re: TreeCache standalone, Tomcat 5.0.28, NoClassDefFoundErro

                        OK, I think I know why. I have been using the latest jboss-head library. And it ran fine. The culprit is javassist.jar library. It seems it has that problem bundled in JBossCache1.1 release (I was able to re-produce your problem).

                        Can you update the library from the latest jboss-head? That sould solve your problem!!

                        We have JBossCache1.2 release scheduled early next month that will have the new library.

                        Thanks,

                        -Ben

                        • 9. Re: TreeCache standalone, Tomcat 5.0.28, NoClassDefFoundErro
                          umk

                           

                          "bwang00" wrote:
                          OK, I think I know why. I have been using the latest jboss-head library. And it ran fine. The culprit is javassist.jar library. It seems it has that problem bundled in JBossCache1.1 release (I was able to re-produce your problem).

                          Can you update the library from the latest jboss-head? That sould solve your problem!!

                          We have JBossCache1.2 release scheduled early next month that will have the new library.

                          Thanks,

                          -Ben


                          I downloaded a newer javassist library and retested. The problem is now solved with the test application. I will test further with the complex webapp we're using.

                          Thank you for your help!