0 Replies Latest reply on Jun 25, 2013 4:08 AM by Radai Rosenblatt

    issues with replicated infinispan cache and classloading - ClassNotFoundException deserializing packet

    Radai Rosenblatt Newbie

      Hi.

       

      I have an *.ear deployed on 2 clustered AS7 (7.1.3) machines, inside this ear is an ejb jar that uses drools (drools jars are packed in the ear's /lib directory).

      this application uses a replicated infinispan cache, defined with module="deployment.my.ear" which, according to the docs, means the cache uses the deployment's classpath.

       

      the class that i place as a value into the cache is externalizable, and serializes/deserializes drools classes in its writeExternal()/readExternal() methods.

       

      when i put something in the cache from node A, i get the following exception on the receiving node B (also mirrored in A's log):

       

      Caused by: java.lang.ClassNotFoundException: org.drools.rule.DialectRuntimeRegistry from [Module "org.jboss.as.clustering.common:main" from local module loader @3c941140 (roots: C:\[install dir]\modules)]

          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

          at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

          at java.lang.Class.forName0(Native Method) [rt.jar:1.7.0_25]

          at java.lang.Class.forName(Class.java:270) [rt.jar:1.7.0_25]

          at org.drools.common.DroolsObjectInputStream.resolveClass(DroolsObjectInputStream.java:88) [drools-core.jar:5.1.1]

          at org.drools.common.DroolsObjectInputStream.resolveClass(DroolsObjectInputStream.java:100) [drools-core.jar:5.1.1]

          at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1610) [rt.jar:1.7.0_25]

          at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1515) [rt.jar:1.7.0_25]

          at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1769) [rt.jar:1.7.0_25]

          at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348) [rt.jar:1.7.0_25]

          at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370) [rt.jar:1.7.0_25]

          at org.drools.rule.Package.readExternal(Package.java:197) [drools-core.jar:5.1.1]

          at org.drools.definitions.impl.KnowledgePackageImp.readExternal(KnowledgePackageImp.java:115) [drools-core.jar:5.1.1]

          at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1259) [jboss-marshalling-river-1.3.15.GA.jar:1.3.15.GA]

          at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:272) [jboss-marshalling-river-1.3.15.GA.jar:1.3.15.GA]

          at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:209) [jboss-marshalling-river-1.3.15.GA.jar:1.3.15.GA]

          at org.jboss.marshalling.AbstractObjectInput.readObject(AbstractObjectInput.java:37) [jboss-marshalling-1.3.15.GA.jar:1.3.15.GA]

          at org.infinispan.marshall.exts.ArrayListExternalizer.readObject(ArrayListExternalizer.java:57) [infinispan-core-5.1.7.Final.jar:5.1.7.Final]

          at org.infinispan.marshall.exts.ArrayListExternalizer.readObject(ArrayListExternalizer.java:45) [infinispan-core-5.1.7.Final.jar:5.1.7.Final]

          at org.infinispan.marshall.jboss.ExternalizerTable$ExternalizerAdapter.readObject(ExternalizerTable.java:395) [infinispan-core-5.1.7.Final.jar:5.1.7.Final]

          at org.infinispan.marshall.jboss.ExternalizerTable.readObject(ExternalizerTable.java:224) [infinispan-core-5.1.7.Final.jar:5.1.7.Final]

          at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:351) [jboss-marshalling-river-1.3.15.GA.jar:1.3.15.GA]

          at org.jboss.marshalling.river.BlockUnmarshaller.readObject(BlockUnmarshaller.java:153) [jboss-marshalling-river-1.3.15.GA.jar:1.3.15.GA]

          at org.jboss.marshalling.river.BlockUnmarshaller.readObject(BlockUnmarshaller.java:139) [jboss-marshalling-river-1.3.15.GA.jar:1.3.15.GA]

          at com.my.Class.readExternal(Class.java:321) [my-ejb.jar:version]

          at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1259) [jboss-marshalling-river-1.3.15.GA.jar:1.3.15.GA]

          at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:272) [jboss-marshalling-river-1.3.15.GA.jar:1.3.15.GA]

          at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:209) [jboss-marshalling-river-1.3.15.GA.jar:1.3.15.GA]

          at org.jboss.marshalling.AbstractObjectInput.readObject(AbstractObjectInput.java:37) [jboss-marshalling-1.3.15.GA.jar:1.3.15.GA]

          at org.infinispan.marshall.exts.ReplicableCommandExternalizer.readParameters(ReplicableCommandExternalizer.java:119) [infinispan-core-5.1.7.Final.jar:5.1.7.Final]

          at org.infinispan.marshall.exts.ReplicableCommandExternalizer.readObject(ReplicableCommandExternalizer.java:107) [infinispan-core-5.1.7.Final.jar:5.1.7.Final]

          at org.infinispan.marshall.exts.ReplicableCommandExternalizer.readObject(ReplicableCommandExternalizer.java:58) [infinispan-core-5.1.7.Final.jar:5.1.7.Final]

          at org.infinispan.marshall.jboss.ExternalizerTable$ExternalizerAdapter.readObject(ExternalizerTable.java:395) [infinispan-core-5.1.7.Final.jar:5.1.7.Final]

          at org.infinispan.marshall.jboss.ExternalizerTable.readObject(ExternalizerTable.java:224) [infinispan-core-5.1.7.Final.jar:5.1.7.Final]

          at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:351) [jboss-marshalling-river-1.3.15.GA.jar:1.3.15.GA]

          at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:209) [jboss-marshalling-river-1.3.15.GA.jar:1.3.15.GA]

          at org.jboss.marshalling.AbstractObjectInput.readObject(AbstractObjectInput.java:37) [jboss-marshalling-1.3.15.GA.jar:1.3.15.GA]

          at org.infinispan.marshall.exts.ReplicableCommandExternalizer.readParameters(ReplicableCommandExternalizer.java:119) [infinispan-core-5.1.7.Final.jar:5.1.7.Final]

          at org.infinispan.marshall.exts.CacheRpcCommandExternalizer.readObject(CacheRpcCommandExternalizer.java:162) [infinispan-core-5.1.7.Final.jar:5.1.7.Final]

          at org.infinispan.marshall.exts.CacheRpcCommandExternalizer.readObject(CacheRpcCommandExternalizer.java:66) [infinispan-core-5.1.7.Final.jar:5.1.7.Final]

          at org.infinispan.marshall.jboss.ExternalizerTable$ExternalizerAdapter.readObject(ExternalizerTable.java:395) [infinispan-core-5.1.7.Final.jar:5.1.7.Final]

          at org.infinispan.marshall.jboss.ExternalizerTable.readObject(ExternalizerTable.java:224) [infinispan-core-5.1.7.Final.jar:5.1.7.Final]

          at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:351) [jboss-marshalling-river-1.3.15.GA.jar:1.3.15.GA]

          at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:209) [jboss-marshalling-river-1.3.15.GA.jar:1.3.15.GA]

          at org.jboss.marshalling.AbstractObjectInput.readObject(AbstractObjectInput.java:37) [jboss-marshalling-1.3.15.GA.jar:1.3.15.GA]

          at org.infinispan.marshall.jboss.AbstractJBossMarshaller.objectFromObjectStream(AbstractJBossMarshaller.java:163) [infinispan-core-5.1.7.Final.jar:5.1.7.Final]

          at org.infinispan.marshall.VersionAwareMarshaller.objectFromByteBuffer(VersionAwareMarshaller.java:114) [infinispan-core-5.1.7.Final.jar:5.1.7.Final]

          at org.infinispan.marshall.AbstractDelegatingMarshaller.objectFromByteBuffer(AbstractDelegatingMarshaller.java:104) [infinispan-core-5.1.7.Final.jar:5.1.7.Final]

          at org.infinispan.remoting.transport.jgroups.MarshallerAdapter.objectFromBuffer(MarshallerAdapter.java:50) [infinispan-core-5.1.7.Final.jar:5.1.7.Final]

          at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.handle(CommandAwareRpcDispatcher.java:200) [infinispan-core-5.1.7.Final.jar:5.1.7.Final]

          ... 30 more

       

      whats even stranger here is that the above exception shows that infinispan has successfully located my class (packaged inside the ejb jar inside the ear) yet completely failed to find the drools classes (packaged in drools *.jars inside the ear's /lib)

       

      what am i doing wrong?