Details
-
Bug
-
Resolution: Done
-
Major
-
JBossAS-3.2.6 Final
-
None
Description
SourceForge Submitter: starksm .
When a value is placed into the http session that
corresponds to a class only available in the war, the
following CNFE exception occurs:
20:35:14,653 ERROR [JGStore] could not demarshal
incoming update
java.lang.ClassNotFoundException: No ClassLoaders found
for: org.jboss.chap9.ex1.SessionValue
at
org.jboss.mx.loading.LoadMgr.beginLoadTask(LoadMgr.java:155)
at
org.jboss.mx.loading.UnifiedClassLoader3.loadClass(UnifiedClassLoader3.java:161)
at
java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:217)
at
org.mortbay.j2ee.session.MarshallingInterceptor$ObjectInputStream.resolveClass(MarshallingInterceptor.java:70)
at
java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1513)
at
java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1626)
at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at
java.io.ObjectInputStream.readArray(ObjectInputStream.java:1603)
at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1271)
at
java.io.ObjectInputStream.readArray(ObjectInputStream.java:1603)
at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1271)
at
java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
at
org.javagroups.blocks.MethodCall.readExternal(MethodCall.java:432)
at
java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1686)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1644)
at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at
java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
at
org.mortbay.j2ee.session.MarshallingInterceptor.demarshal(MarshallingInterceptor.java:108)
at
org.mortbay.j2ee.session.JGStore$1.objectFromByteBuffer(JGStore.java:166)
at
org.javagroups.blocks.RpcDispatcher.handle(RpcDispatcher.java:249)
at
org.javagroups.blocks.RequestCorrelator.handleRequest(RequestCorrelator.java:531)
at
org.javagroups.blocks.RequestCorrelator.access$100(RequestCorrelator.java:37)
at
org.javagroups.blocks.RequestCorrelator$Request.run(RequestCorrelator.java:747)
at
org.javagroups.util.ReusableThread.run(ReusableThread.java:208)
at java.lang.Thread.run(Thread.java:536)
This is due to the wrong class loader being used by the
store. The web application context class loader needs
to be used. I have put a fix into the 3.2 branch for
this, but this only works if the store is an instance
of AbstractReplicatedStore since the Store interface
does not support setLoader. Look at the following code
block in the Jetty class to see how this should be
generatlized to all Stores.
Line 334 of org.jboss.jetty.Jetty.java:
// The web context class loader is needed for
loading the war state objects
Manager mgr =
app.getDistributableSessionManager();
Store store = mgr.getStore();
if( store instanceof AbstractReplicatedStore )