[jboss-dev] Re: Classloading Gotcha in JDK6
Andrig T Miller
anmiller at redhat.com
Wed Jun 13 18:19:47 EDT 2007
There was a bug raised on this with Sun, and it is as follows:
They are actually not going to fix this, but instead want you to use
what you describe below. We will have to change our code accordingly in
AS 5 and anywhere else for that matter to support JDK 6.
On Wed, 2007-06-13 at 17:12 -0500, Jason T. Greene wrote:
> There is an undocumented system property (besides the jvm source) in JDK
> 5 and 6 called "sun.lang.ClassLoader.allowArraySyntax". The default
> changed from true to false in JDK6. So what this means is that in JDK6,
> unless you set that property to true, if you try and load a Java array
> type using a classloader (e.g. "[[B") you will get a CNFE.
> The compatible solution is to either interpret array types directly (not
> hard), or to use the extended form of Class.forName(), which does
> understand the array syntax:
> Class clazz = Class.forName(className, false, loader);
Andrig (Andy) Miller
VP of Engineering
JBoss, a division of Red Hat
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the jboss-development