users@glassfish.java.net

Re: Can't create embeddable AppClientContainer (ACC ) ?

From: <glassfish_at_javadesktop.org>
Date: Mon, 11 Jan 2010 07:29:29 PST

I think you have found a bug.

The AppClientContainerBuilder class is incorrectly trying to cast the current thread's context class loader to ACCClassLoader. For reasons related to the internal implementation of the ACC, the class loader needs to be a URLClassLoader (or an instance of a subclass of URLClassLoader) but the requirement for it to be an ACCClassLoader is too strict.

Until we fix this, one of these workarounds should work:

1. On your java command line specify -Djava.system.class.loader=org.glassfish.appclient.client.acc.ACCClassLoader. This should work if your application does not set the current thread's context class loader anywhere.

Or,

2. In your Java program instantiate an ACCClassLoader and set it to be the current thread's context class loader using Thread.currentThread().setContextClassLoader.

Sorry for this complication. Please let us know if one of these works for you.

- Tim
[Message sent by forum member 'tjquinn' (timothy.quinn_at_sun.com)]

http://forums.java.net/jive/thread.jspa?messageID=380091