users@glassfish.java.net

How do I replace one of Glassfish's classloaders with a custom classloader

From: <forums_at_java.net>
Date: Fri, 11 Nov 2011 16:26:38 -0600 (CST)

 I couldn't find anything in the Glassfish Docs about replacing one of the
default classloaders with a custom classloader.

I want to use a custom classloader in Glassfish 3.1 in order to load
encrypted .jar files from a .war file. I can specify a custom classloader at
startup like this

    -Djava.system.class.loader=com.myco.classloader.CustomClassLoader

I believe this will replace the Bootstrap classloader with my custom
classloader, but what I should probably do is replace the archive classloader
in Glassfish's classloader hierarchy as shown
here download.oracle.com/docs/cd/E19226-01/820-7695/6niugesfp/index.html#indexterm-28
[1].

Is there a way to replace a particular classloader in Glassfish's classloader
hierarchy, or does that require modifying the Glassfish source code? I'm
hoping there is an asadmin option or something in the admin console that will
do this.

Thanks.

 


[1]
http://download.oracle.com/docs/cd/E19226-01/820-7695/6niugesfp/index.html#indexterm-28

--
[Message sent by forum member 'dwschulze']
View Post: http://forums.java.net/node/863375