Bugs item #858444, was opened at 2003-12-11 10:45
Message generated for change (Comment added) made by starksm
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=858444&group_id=22866

>Category: JBossServer
Group: v3.2
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Barry M. Caceres (barrycaceres)
>Assigned to: Scott M Stark (starksm)
Summary: Deserialization Broken for java.lang.Class for RMI calls

Initial Comment:
It appears that the code that handles deserialization 
of method parameters in RMI calls is failing to properly 
deserialize instances of java.lang.Class. This occurs 
when I call 
an EJB methods remotely and not during any other 
serialization or 
deserialization (i.e.: I could not replicate this when 
serializing 
the object to a ByteArrayOutputStream and then 
deserializing from 
a ByteArrayInputStream -- I also tried with a 
FileOutputStream and 
FileInputStream and could not reproduce the behavior). 

The bug manifests itself when trying to deserialize 
java.lang.Integer.TYPE 
which represents the "int" primitive type as a 
java.lang.Class object. 
(I imagine the bug would also appear if deserializing 
Float.TYPE, 
Double.TYPE, or any other primitive TYPE constant). 

It appears that the deserialization is attempting to 
perform a 
Class.forName(String) on "int", which then fails with a 
message about 
there being no class loaders for class "int". 

The primitive types should be a special case in the 
deserialization method and looked up in a table. 

Like I said, this only occurs when I try to send 
Integer.TYPE over 
the wire to an EJB remote method call (not during 
deserialization 
from a ObjectInputStream based on a 
ByteArrayInputStream or 
FileInputStream) 

>From the stack trace it looks like the problem is actually 
in the 
org.jboss.invocation.MarshalledValueInputStream class. 

Any help with this matter would be great (especially info 
on how to 
fix it in my local 3.2.1 & 3.2.2 source code). 

Here is the stack-trace snippet.... 

15:22:39,841 ERROR [STDERR] 
java.lang.ClassNotFoundException: No 
ClassLoaders found for: int 
15:22:39,843 ERROR [STDERR] at 
org.jboss.mx.loading.LoadMgr3.beginLoadTask
(LoadMgr3.java:241) 
15:22:39,843 ERROR [STDERR] at 
org.jboss.mx.loading.UnifiedClassLoader3.loadClassImpl
(UnifiedClassLoader3.java:169) 
15:22:39,843 ERROR [STDERR] at 
org.jboss.mx.loading.UnifiedClassLoader3.loadClass
(UnifiedClassLoader3.java:123) 
15:22:39,844 ERROR [STDERR] at 
java.lang.ClassLoader.loadClass(ClassLoader.java:235) 
15:22:39,844 ERROR [STDERR] at 
org.jboss.util.loading.DelegatingClassLoader.loadClass
(DelegatingClassLoader.java:77) 
15:22:39,844 ERROR [STDERR] at 
org.jboss.mx.loading.LoaderRepositoryClassLoader.loadCla
ss(LoaderRepositoryClassLoader.java:78) 
15:22:39,844 ERROR [STDERR] at 
java.lang.ClassLoader.loadClass(ClassLoader.java:235) 
15:22:39,844 ERROR [STDERR] at 
org.jboss.util.loading.DelegatingClassLoader.loadClass
(DelegatingClassLoader.java:77) 
15:22:39,845 ERROR [STDERR] at 
java.lang.ClassLoader.loadClass(ClassLoader.java:235) 
15:22:39,845 ERROR [STDERR] at 
java.lang.ClassLoader.loadClassInternal
(ClassLoader.java:302) 
15:22:39,845 ERROR [STDERR] at 
java.lang.Class.forName0(Native Method) 
15:22:39,845 ERROR [STDERR] at 
java.lang.Class.forName(Class.java:219) 
15:22:39,845 ERROR [STDERR] at 
org.jboss.invocation.MarshalledValueInputStream.resolve
Class(MarshalledValueInputStream.java:95) 
15:22:39,845 ERROR [STDERR] at 
java.io.ObjectInputStream.readNonProxyDesc
(ObjectInputStream.java:1513) 
15:22:39,846 ERROR [STDERR] at 
java.io.ObjectInputStream.readClassDesc
(ObjectInputStream.java:1435) 
15:22:39,846 ERROR [STDERR] at 
java.io.ObjectInputStream.readClass
(ObjectInputStream.java:1402) 
15:22:39,846 ERROR [STDERR] at 
java.io.ObjectInputStream.readObject0
(ObjectInputStream.java:1260) 
15:22:39,846 ERROR [STDERR] at 
java.io.ObjectInputStream.defaultReadFields
(ObjectInputStream.java:1845) 
15:22:39,846 ERROR [STDERR] at 
java.io.ObjectInputStream.readSerialData
(ObjectInputStream.java:1769) 
15:22:39,847 ERROR [STDERR] at 
java.io.ObjectInputStream.readOrdinaryObject
(ObjectInputStream.java:1646) 
15:22:39,847 ERROR [STDERR] at 
java.io.ObjectInputStream.readObject0
(ObjectInputStream.java:1274) 
15:22:39,847 ERROR [STDERR] at 
java.io.ObjectInputStream.defaultReadFields
(ObjectInputStream.java:1845) 
15:22:39,847 ERROR [STDERR] at 
java.io.ObjectInputStream.defaultReadObject
(ObjectInputStream.java:452) 


----------------------------------------------------------------------

>Comment By: Scott M Stark (starksm)
Date: 2003-12-11 19:09

Message:
Logged In: YES 
user_id=175228

This has been fixed by delegating to the
ObjectInputStream.resolveClass() method if the TCL cannot
find the class.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=858444&group_id=22866


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to