On Fri, 18 Jan 2002, Hans Schlenker wrote:

> Date: Fri, 18 Jan 2002 18:36:18 +0100
> From: Hans Schlenker <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: Tomcat Users List <[EMAIL PROTECTED]>
> Subject: howto install shared jar's at runtime
>
>
> Hi!
>
> How can I install a jar package at $CATALINA_HOME/lib at Tomcat
> *runtime* such that webapps may use its contents right after
> installation (without restarting Tomcat, since this is not possible
> remotely)?
>
> The intended sequence is:
> - start Tomcat
> - install a new webapp using the Tomcat manager app remotely
> - start the new webapp: this initially copies a new
>   package shrd.jar into $CATALINA_HOME/lib
> (-maybe restart the new web app)
> - use the new shrd.jar package within the new web app (currently,
>   this raises a java.lang.NoClassDefFoundError)
> In case a new version of the webapp is available:
> - shut down old webapp version
> - install new version under new webapp path (since if the old
>   one is used, the old files are not overwritten by the manager)
> - use new webapp version with already loaded package shrd.jar
>
> Tchnical background: I have to install the shrd.jar package in a shared
> place since it relates to some native library that is also copied into
> the Tomcat tree at runtime and initialized and started the first time,
> the shared package is used. If shrd.jar is copied into the webapp's
> WEB-INF/lib directory, it would be loaded separately for each web app
> instance. Thus, the new web app instance would load a new shrd.jar
> instance which does not have any reference to the already loaded native
> library.
>
> Another and even better solution to this and some other problems we
> have, would be to remotely restart Tomcat (i.e. its JVM)! Might this be
> possible?
>
> Any hint would be appreciated!
>

Adding a new JAR file to the "lib" directory after Tomcat has been started
won't do any good -- the class loader got constructed at startup time
based on the contents of the "lib" directory then.  You will need to
ensure that your startup order copies the JAR files *before* starting
Tomcat -- or else, you'll need to restart Tomcat after copying.

> Best regards,
>
> Hans
>

Craig


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to