Sun GlassFish Enterprise Server v3 Release Notes

Embedded ACC overly strict on current thread context class loader (Issue 11427)

Description

The ACC expects the current thread's context class loader to be an ACCClassLoader. This is overly restrictive. Although this condition is met for appclient script and Java Web Start launches, it might not be met for the embedded case. Other functions inside the ACC require the class loader to be a URLClassLoader (or an instance of a subclass of URLClassLoader), but the loader does not need to be an ACCClassLoader.

For more information, see Issue report.

Workaround

Two workarounds are available:

  1. Set -Djava.system.class.loader=org.glassfish.appclient.client.acc.ACCClassLoader, 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 before using the embedded ACC classes and interfaces.