[jboss-user] [JBossCache] - Re: java.io.NotSerializableException: WebappClassLoader

bstansberry@jboss.com do-not-reply at jboss.com
Thu Apr 5 10:08:32 EDT 2007


The problem is that since you're invoking via the JMX server, the thread context classloader gets switched when you call get() to one that doesn't know about your classes.

Fortunately, JBoss Cache has a hack built in that lets you get around the problem. It lets you get ahold of the actual TreeCache instance via the mbean proxy.  Once you've done that you can directly invoke on the TreeCache and you shouldn't have this problem.


  | MBeanServer server = MBeanServerLocator.locateJBoss();
  | TreeCacheMBean mbeanProxy = (TreeCacheMBean)MBeanProxyExt.create(TreeCacheMBean.class, "jboss.cache:service=TreeCache", server);
  | treecache = mbeanProxy.getInstance();
  | treecache.registerClassLoader("/command_image/", Thread.currentThread().getContextClassLoader());
  | isInited = true;

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4035017#4035017

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4035017



More information about the jboss-user mailing list