I don't know if the subject of this message is right ... but i think that's
the general problem i'm having ... I have an RMI server (MBean) that has a
method exposed that takes a plain Object. This Object is then serialized out
to storage so that it can be retrieved later ... The problem I'm having is
that when I try to deserialize the object, I get a ClassNotFoundException
... My suspicion is that the RMI framework is using a different ClassLoader
than the application code for my RMI server ... Is there anything I can do
about this? (aside from putting the classes in the classpath on the RMI
server ahead of time?)

I'm using JBOSS 3.0.4 on JDK 1.3

Here's my sample code (i've stripped it down so that the call serializes the
object into a byte[] array, then tries to deserialize it immeidately ...
this demonstrate that even within the RMI call itself, i am unable to
instantiate the object); the "setObject()" method is the exposed RMI method
..

public void setObject(String sessionID, String key, Object value)
throws Exception{

        java.io.ByteArrayOutputStream bytesOut = new
java.io.ByteArrayOutputStream();
        java.io.ObjectOutputStream objectOut = new
java.io.ObjectOutputStream(bytesOut);
        objectOut.writeObject(value);
        objectOut.flush();
        objectOut.close();
        bytesOut.flush();
        bytesOut.close();

        byte[] buf = bytesOut.toByteArray();

        java.io.ByteArrayInputStream bytesIn = new
java.io.ByteArrayInputStream(buf);
        java.io.ObjectInputStream objIn = new java.io.ObjectInputStream(bytesIn);
        Object obj = objIn.readObject(); //Exception raised here
        objIn.close();
        bytesIn.close();

}


The exception is raised on the readObject() call ...

java.lang.ClassNotFoundException: No ClassLoaders found for:
com.newnetco.trivialpursuit.servlets.DaveObject
        at org.jboss.mx.loading.LoadMgr.beginLoadTask(LoadMgr.java:138)
        at
org.jboss.mx.loading.UnifiedClassLoader3.loadClass(UnifiedClassLoader3.java:
140)
        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:195)
        at
java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:654)
        at
java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java:918)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:366)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
        at
java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1186)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
        at xxxxxx.setObject(SessionManagerImpl.java:270)

Thanks in advance,
Dave



-------------------------------------------------------
This SF.NET email is sponsored by:  The Best Geek Holiday Gifts!
Time is running out!  Thinkgeek.com has the coolest gifts for
your favorite geek.   Let your fingers do the typing.   Visit Now.
T H I N K G E E K . C O M        http://www.thinkgeek.com/sf/
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to