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

    HELP: ClassNotFound exception

    fredatwork Newbie

      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.