Apache Geronimo > Discussion Forums  User List | Dev List | Wiki | Issue Tracker  

 « Return to Thread: Dynamically load jars in running state

Re: Dynamically load jars in running state

by stig larsen :: Rate this Message:

Reply to Author | View in Thread

Thank you for your swift reply Jack,

I'm also looking into the Gbean and dependency injection, and it seems like it could be done from here aswell?
The idea is to insert this extensions (jar file) to the geronimo repository and dynamically load them from there.

Is using MultiParentClassLoader  the preferred method?

Best regards,
Stig Even Larsen


Jack Cai wrote:
There is a very Geronimo-specific way with which you can hack with the
application classloader.

import org.apache.geronimo.kernel.config.MultiParentClassLoader;

  ...
  url = a certain folder or a jar file
  MultiParentClassLoader cl = (MultiParentClassLoader)
Thread.currentThread.getContextClassloader();
  cl.addURL(url);
  ...

Good luck.

-Jack

2009/6/18 stig larsen <stig@exectiva.no>

>
> Hi,
>
> We have an application that we wish to extend its capabilities in running
> state.
> I want to load jars into geronimo and make them appear in the classpath so
> my application can use them without restarting.
>
> Is there a way to to this?
>
> Best regards,
> Stig Even Larsen
> --
> View this message in context:
> http://www.nabble.com/Dynamically-load-jars-in-running-state-tp24087873s134p24087873.html
> Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
>
>

 « Return to Thread: Dynamically load jars in running state