mrpantsuit

ContextClassLoader PluginClassLoader AccessControlException

Discussion created by mrpantsuit on Mar 30, 2007
Latest reply on Mar 30, 2007 by mrpantsuit

I have a plugin that uses an ExecutorService to spawn new threads that do some dynamic class loading.

 

I learned that PluginClassLoader is used to initially load all my plugin classes (naturally).  However, the context ClassLoader of the threads spawned by the ExecutorService is some AppClassLoader, which fails when trying to load my plugin''s classes.

 

I tried setting the context ClassLoader of the new threads to be the PluginClassLoader, but I get "java.security.AccessControlException:  access denied (java.lang.RuntimePermission setContextClassLoader)".

 

Any advice?

Outcomes