In case anyone has this same problem, this ended up being a JVM bug (in my opinion) 
that was exposed by the way JBoss was loading classes.  Basically the 
ClassLoader.loadClass(String) method doesn't work consistently for loading array 
types, especially when the array's component type hasn't already been loaded.  In 
other words, if y ou just try this code:

ClassLoader loader = Thread.currentThread().getContextClassLoader();
Class clazz = loader.loadClass("[Ljava.lang.Integer;");

it would give you a ClassNotFoundException.  If you added the following line directly 
above that code:

Integer[] intArray = new Integer[]{};

the classloader would be able to load that class.

The problem in JBoss is that org.jboss.invocation.MarshalledValueInputStream in 3.2.1 
only uses the ClassLoader.loadClass(String) method to resolve classes, and doesn't 
fall back to the Class.forName(String) method, as Sun has now advised.

This has apparently been fixed in JBoss 3.2.3, although I'm not sure which build.

Just FYI, this same problem appears in WebStart.  The JNLPClassLoader won't be able to 
load via the array syntax unless you use the above workaround to instantiate that 
class yourself.  How's that for Sun's right hand not knowing what the left is doing ;)

Thanks,
Matt

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3831674#3831674

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3831674


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to