Re: Dynamically load jars in running state
Hi David, This application handles numerous commands, and these are handled in the application. But when a customer wants additional functions/commands we need to add these dynamically without redeploy the application and/or libraries (which are stored in geronimo repository). The commands are defined in an interface which all all commands must address. These commands correspond to a class with the same name, and thus are easy to create if they could be found on the classpath. The question is really if it is possible to add a jar to the geronimo repository and have a running application use it (place the newly repository added jar on the applicaton classpath ) ? I've been looking at gbeans and dependency injection. This could be a solution. Your advice would be appreciated. Best regards, Stig Even Larsen djencks wrote: > > > On Jun 18, 2009, at 12:33 AM, stig larsen wrote: > >> >> 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? > > As others have pointed out, anything like this is going to be platform > specific. Could you describe a bit more what kind of problem you are > trying to solve? We might be able to suggest a more appropriate > solution than changing the contents of existing classloaders which > always seems to me a risky proposition. > > thanks > david jencks > > >> >> 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. >> > > -- View this message in context: http://www.nabble.com/Dynamically-load-jars-in-running-state-tp24087873s134p24099582.html Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
Re: Dynamically load jars in running state
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 > >> >> 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. >> >> > > -- View this message in context: http://www.nabble.com/Dynamically-load-jars-in-running-state-tp24087873s134p24090342.html Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
Dynamically load jars in running state
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.