[infinispan-issues] [JBoss JIRA] (ISPN-2841) DefaultExecutorService: No possibility to set ClassLoader used for cloning Callables

Carsten Lohmann (JIRA) jira-events at lists.jboss.org
Thu Feb 21 03:56:57 EST 2013


Carsten Lohmann created ISPN-2841:
-------------------------------------

             Summary: DefaultExecutorService: No possibility to set ClassLoader used for cloning Callables
                 Key: ISPN-2841
                 URL: https://issues.jboss.org/browse/ISPN-2841
             Project: Infinispan
          Issue Type: Bug
          Components: Distributed Execution and Map/Reduce
    Affects Versions: 5.2.1.Final
            Reporter: Carsten Lohmann
            Assignee: Vladimir Blagojevic


When using the DistributedExecutorService we noticed that the ContextClassLoader of the current thread is used for cloning the Callable.

But this ClassLoader wasn't able to find the Callable class in our case, so we got this exception:
{noformat}
org.infinispan.CacheException: java.lang.ClassNotFoundException: [...]Callable
 at org.infinispan.util.Util.cloneWithMarshaller(Util.java:259)
 at org.infinispan.distexec.DefaultExecutorService.clone(DefaultExecutorService.java:555)
 at org.infinispan.distexec.DefaultExecutorService.submitEverywhere(DefaultExecutorService.java:510)
 at org.infinispan.distexec.DefaultExecutorService.submitEverywhere(DefaultExecutorService.java:497)
[...]
Caused by: java.lang.ClassNotFoundException: [...]Callable
 at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
 at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Class.java:264)
 at org.jboss.marshalling.AbstractClassResolver.loadClass(AbstractClassResolver.java:135)
 at org.jboss.marshalling.AbstractClassResolver.resolveClass(AbstractClassResolver.java:116)
 at org.jboss.marshalling.river.RiverUnmarshaller.doReadClassDescriptor(RiverUnmarshaller.java:893)
 at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1205)
 at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:272)
 at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:209)
 at org.jboss.marshalling.AbstractObjectInput.readObject(AbstractObjectInput.java:37)
 at org.infinispan.marshall.jboss.AbstractJBossMarshaller.objectFromObjectStream(AbstractJBossMarshaller.java:163)
 at org.infinispan.marshall.VersionAwareMarshaller.objectFromByteBuffer(VersionAwareMarshaller.java:116)
 at org.infinispan.marshall.AbstractMarshaller.objectFromByteBuffer(AbstractMarshaller.java:106)
 at org.infinispan.marshall.AbstractDelegatingMarshaller.objectFromByteBuffer(AbstractDelegatingMarshaller.java:99)
 at org.infinispan.util.Util.cloneWithMarshaller(Util.java:254)
{noformat}

So there should be a possibility to explicitly set the ClassLoader that the ExecutorService will use for cloning the Callable.

Maybe by using the ClassLoader set via AdvancedCache.with(ClassLoader) on the AdvancedCache given to the ExecutorService.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the infinispan-issues mailing list