7 Replies Latest reply on Feb 8, 2005 2:30 PM by glj

    HELP: ClassNotFound exception

    fredatwork

      I fail putting an object in the JBossCache from within a session bean.

      I'm using JBoss AS 4.0.0.

      The object I want to put in the cache is created (instance of com.rubis.app.runtime.programs.SignalProgramCache) in memory. However, I fail putting it in the cache because I get a ClassNotFoundException.

      Here are the instructions I use to put the object in the cache:

      SimpleProgramCache object = ...; // Creates a valid POJO
      String serviceName = ....; // The valid na;e of my JBossCache TreeCacheAOP service
      MBeanServer server = MBeanServerLocator.locate();
      TreeCacheAopMBean cache = (TreeCacheAopMBean) MBeanProxyExt.create(
       TreeCacheAopMBean.class,
       serviceName,
       server);
      cache.putObject("/program/signals", object);
      


      Here is the exception I get :
      org.jboss.util.NestedRuntimeException: java.lang.ClassNotFoundException: No ClassLoaders found for: com.rubis.app.runtime.programs.SignalProgramCache; - nested throwable: (java.lang.IllegalArgumentException: java.lang.ClassNotFoundException: No ClassLoaders found for: com.rubis.app.runtime.programs.SignalProgramCache)
      at org.jboss.cache.TreeCache.invokeMethod(TreeCache.java:3176)
      at org.jboss.cache.TreeCache.put(TreeCache.java:1735)
      at org.jboss.cache.aop.TreeCacheAop._putObject(TreeCacheAop.java:293)
      at org.jboss.cache.aop.TreeCacheAop.putObject(TreeCacheAop.java:128)
      at org.jboss.cache.aop.TreeCacheAop.putObject(TreeCacheAop.java:109)
      .../...
      


      I do not understand why JBossCache cannot find my custom SignalProgramCache class since JBoss AS created first in memory.
      The class is available.

      I suspect this could be linked to my EAR deployment that JBossCache cannot use properly. My ear file contains 1 EJB jar file and 1 WAR file (nothing weard ...). The EJB jar file contains the com.rubis.app.runtime.programs.SignalProgramCache.class file (nothing weard either ...).

      I really need some help here. I'm completely stucked.


        • 1. Re: HELP: ClassNotFound exception

          If you can create a sample project that illustrates this problem (i.e., has the build.xml that can package the ear, etc.), I will be happy to take a look for you.

          -Ben

          • 2. Re: HELP: ClassNotFound exception
            fredatwork

            Hi Ben,

            Thanks for your proposal. It's nice from you.

            I've built a very small test case for you.

            How can I mail it to you with proper instructions ?

            My email is fredatwork@free.fr

            Happy new year !

            Fred

            • 3. Re: HELP: ClassNotFound exception
              starksm64

              Bug reports should be created in jira:
              http://jira.jboss.com/jira/browse/JBCACHE

              • 4. Re: HELP: ClassNotFound exception
                fredatwork

                I figured out my problem was due to JBoss 4.0.0 which class loader is buggy.

                I installed JBoss 4.0.1 and the problem disapeared.

                I aslo realized that JBoss 4.0.0 has real trouble with its class loading mechanism. It is obviously fixed with JBoss 4.0.1.

                Fred

                • 5. Re: HELP: ClassNotFound exception

                  Fred,

                  I have closed the JIRA issue.

                  -Ben

                  • 6. Re: HELP: ClassNotFound exception
                    starksm64

                    The only difference between 4.0.0 and 4.0.1 is a default configuration of the class loading. See the release notes and readmes to see what the differences are.

                    • 7. Re: HELP: ClassNotFound exception
                      glj

                      I've been developing under 4.0.0 almost since it came out with no problems. A session bean was added to the app and the errors below started showing up in the log. Upgrading to 4.0.1 fixed whatever was broken. Just adding this to help anyone else that experiences this problem.

                      java.lang.ClassNotFoundException: No ClassLoaders found for:

                      Caused by: java.rmi.ServerException: RuntimeException; nested exception is: java.lang.NullPointerException at org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:361)

                      ERROR [org.jboss.ejb.plugins.LogInterceptor] RuntimeException in method: public abstract java.util.Map com.ess.vv.ejb.webaccess.WebAccess.getRegistrantsAsMap(com.ess.vv.SearchForm) throws javax.ejb.EJBException,java.rmi.RemoteException: java.lang.NullPointerException at org.jboss.ejb.plugins.CallValidationInterceptor.validateArguments(CallValidationInterceptor.java:58)