Re: Deploying shared .jar's
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chuck, Caldarale, Charles R wrote: From: Christopher Schultz [mailto:[EMAIL PROTECTED] Subject: Re: Deploying shared .jar's Was that feature changed in the 5.0 and later versions? My 4.1.x version allows me to put files into $CATALINA_HOME/common/lib and have them available to all webapps which are deployed in their own CATALINA_BASE's. Nothing's changed (until 6.0). The original question was specifically about the shared directory, and you're using the common directory. Oh, hey... look at that. I had assumed that common was changed to shared as well in the new versions. I didn't realize that you could pick which one to use. Does that mean that Dave can put his JAR file into $CATALINA_HOME/common/lib instead of $CATALINA_HOME/shared/lib and he will get the desired behavior? Someone's suggestion of modifying catalina.properties is a little dangerous, especially when you upgrade and forget to migrate that change. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFfr1k9CaO5/Lv0PARAt6eAJ9E4EMMNiMIy6w9PmBIMjRC9u7hkwCgtLfa OxNT3mOegkGoEdL5Ng2mMWo= =9ole -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Deploying shared .jar's
Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chuck, Caldarale, Charles R wrote: From: Christopher Schultz [mailto:[EMAIL PROTECTED] Subject: Re: Deploying shared .jar's Was that feature changed in the 5.0 and later versions? My 4.1.x version allows me to put files into $CATALINA_HOME/common/lib and have them available to all webapps which are deployed in their own CATALINA_BASE's. Nothing's changed (until 6.0). The original question was specifically about the shared directory, and you're using the common directory. Oh, hey... look at that. I had assumed that common was changed to shared as well in the new versions. I didn't realize that you could pick which one to use. Does that mean that Dave can put his JAR file into $CATALINA_HOME/common/lib instead of $CATALINA_HOME/shared/lib and he will get the desired behavior? I believe I tried that, but I don't remember for sure. Someone's suggestion of modifying catalina.properties is a little dangerous, especially when you upgrade and forget to migrate that change. - -chris - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Deploying shared .jar's
From: Christopher Schultz [mailto:[EMAIL PROTECTED] Subject: Re: Deploying shared .jar's Does that mean that Dave can put his JAR file into $CATALINA_HOME/common/lib instead of $CATALINA_HOME/shared/lib and he will get the desired behavior? Yes, except that shared is under CATALINA_BASE, not CATALINA_HOME. Since _HOME and _BASE are the same in most installations, I can't keep them straight without re-reading the RUNNING.txt file. Note that in Tomcat 6, by default, the shared directory disappears (as does server), and common is renamed to lib. The TC6 RUNNING.txt file indicates that lib should be under CATALINA_BASE, but the catalina.properties file defines the class loader for it as using CATALINA_HOME, so watch out for the discrepancy there. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Deploying shared .jar's
From what I've read in the Tomcat 5.5 docs, I should be able to deploy a .jar that is shared across multiple webapps on Windows by putting it in the (tomcat)/shared/lib folder, but I've never gotten that to work. I've always had to put that jar in the web-inf/lib folder of each of the webapps that need it, in order for them to be able to use it. Why is that? Is there something I'm missing about deploying shared jars? The wasted disk space doesn't matter, but the hassle of putting the same .jar file in multiple different places does... Any help or explanations would be appreciated! Dave - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Deploying shared .jar's
hi, By http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html Shared is the parent classloader of webapp. AFAIK the consequence of this in that a class loaded from webapp classloader can see other classes (whenever they come from shared, webapp or common), but the reverse is not true, and could lead to ClassNotDef or ClassNotFound exeption unless some classloader hack are performed ... On 12/11/06, David Kerber [EMAIL PROTECTED] wrote: From what I've read in the Tomcat 5.5 docs, I should be able to deploy a .jar that is shared across multiple webapps on Windows by putting it in the (tomcat)/shared/lib folder, but I've never gotten that to work. I've always had to put that jar in the web-inf/lib folder of each of the webapps that need it, in order for them to be able to use it. Why is that? Is there something I'm missing about deploying shared jars? The wasted disk space doesn't matter, but the hassle of putting the same .jar file in multiple different places does... Any help or explanations would be appreciated! Dave - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Souviens-toi qu'au moment de ta naissance tout le monde était dans la joie et toi dans les pleurs. Vis de manière qu'au moment de ta mort, tout le monde soit dans les pleurs et toi dans la joie.
Re: Deploying shared .jar's
olivier nouguier wrote: hi, By http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html Shared is the parent classloader of webapp. AFAIK the consequence of this in that a class loaded from webapp classloader can see other classes (whenever they come from shared, webapp or common), but the reverse is not true, and could lead to ClassNotDef or ClassNotFound exeption unless some classloader hack are performed ... This sentence: For classes and resources that must be shared across all web applications, place unpacked classes and resources under |$CATALINA_BASE/shared/classes|, or place JAR files containing those classes and resources under |$CATALINA_BASE/shared/lib|. is exactly what I'm referring to, but I've never gotten this to work. My webapps can't see classes in the .jar that is in the shared/lib folder; I get the ClassNotFound errors when I try. On 12/11/06, David Kerber [EMAIL PROTECTED] wrote: From what I've read in the Tomcat 5.5 docs, I should be able to deploy a .jar that is shared across multiple webapps on Windows by putting it in the (tomcat)/shared/lib folder, but I've never gotten that to work. I've always had to put that jar in the web-inf/lib folder of each of the webapps that need it, in order for them to be able to use it. Why is that? Is there something I'm missing about deploying shared jars? The wasted disk space doesn't matter, but the hassle of putting the same .jar file in multiple different places does... Any help or explanations would be appreciated! Dave - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Deploying shared .jar's
From: David Kerber [mailto:[EMAIL PROTECTED] Subject: Re: Deploying shared .jar's My webapps can't see classes in the .jar that is in the shared/lib folder; I get the ClassNotFound errors when I try. Check your conf/catalina.properties file and make sure this line is present: shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/li b/*.jar If the line is there (and not commented out), is there possibly an access permissions problem with the jars you're putting into shared/lib, especially if running as a service? You might also try turning on -verbose:class and see what's being loaded from where. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Deploying shared .jar's
Caldarale, Charles R wrote: From: David Kerber [mailto:[EMAIL PROTECTED] Subject: Re: Deploying shared .jar's My webapps can't see classes in the .jar that is in the shared/lib folder; I get the ClassNotFound errors when I try. Check your conf/catalina.properties file and make sure this line is present: shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/li b/*.jar It's there, but it got me to looking at some other stuff, and I think I now know what's going on. Can you please tell me if this makes sense: I have 3 different apps on one machine, each running in its own tomcat instance using the catalina_base env var. The catalina_base locations are all outside of catalina_home. What I was hoping was that I could put my shared jars in catalina_home, but after re-reading the description of cataline_base (again), it appears that I can't put shared classes in catalina_home if I'm using the apps from catalina_base. What I have is this: Catalina_home = e:\program files\Apacha\Tomcat5\all the sub-dirs Catalina_base(s) = e:\tomcatclients\webapp1 \conf \webapps etc e:\tomcatclients\webapp2 \conf \webapps etc etc. With the way I read it now, anything I try to put under catalina_home/shared/lib won't be visible to the webapps in the various catalina_base folders. Is this correct? If so, it explains my trouble. If not, then I've got to dig even deeper. Thanks! If the line is there (and not commented out), is there possibly an access permissions problem with the jars you're putting into shared/lib, especially if running as a service? You might also try turning on -verbose:class and see what's being loaded from where. - Chuck - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Deploying shared .jar's
From: David Kerber [mailto:[EMAIL PROTECTED] Subject: Re: Deploying shared .jar's With the way I read it now, anything I try to put under catalina_home/shared/lib won't be visible to the webapps in the various catalina_base folders. Is this correct? Yes. Look at RUNNING.txt in your Tomcat installation directory. To quote from it: When you use this -Dcatalina.base=$CATALINA_BASE argument, Tomcat will calculate all relative references for files in the following directories based on the value of $CATALINA_BASE instead of $CATALINA_HOME: * conf - Server configuration files (including server.xml) * logs - Log and output files * shared - For classes and resources that must be shared across all web applications * webapps - Automatically loaded web applications * work - Temporary working directories for web applications * temp - Directory used by the JVM for temporary files (java.io.tmpdir) Note the inclusion of shared in the CATALINA_BASE set. It would be better if it read For classes and resources that must be shared across all web applications within this Tomcat instance. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Deploying shared .jar's
Caldarale, Charles R wrote: From: David Kerber [mailto:[EMAIL PROTECTED] Subject: Re: Deploying shared .jar's With the way I read it now, anything I try to put under catalina_home/shared/lib won't be visible to the webapps in the various catalina_base folders. Is this correct? Yes. Look at RUNNING.txt in your Tomcat installation directory. To quote from it: When you use this -Dcatalina.base=$CATALINA_BASE argument, Tomcat will calculate all relative references for files in the following directories based on the value of $CATALINA_BASE instead of $CATALINA_HOME: * conf - Server configuration files (including server.xml) * logs - Log and output files * shared - For classes and resources that must be shared across all web applications * webapps - Automatically loaded web applications * work - Temporary working directories for web applications * temp - Directory used by the JVM for temporary files (java.io.tmpdir) Note the inclusion of shared in the CATALINA_BASE set. It would be better if it read For classes and resources that must be shared across all web applications within this Tomcat instance. Yes, that's what I decided on re-reading it for the umpteenth time, when I couldn't get it to work the way I wanted. A bit of clarification by the doc writers might be in order. Dave - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Deploying shared .jar's
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chuck, Caldarale, Charles R wrote: When you use this -Dcatalina.base=$CATALINA_BASE argument, Tomcat will calculate all relative references for files in the following directories based on the value of $CATALINA_BASE instead of $CATALINA_HOME: * conf - Server configuration files (including server.xml) * logs - Log and output files * shared - For classes and resources that must be shared across all web applications * webapps - Automatically loaded web applications * work - Temporary working directories for web applications * temp - Directory used by the JVM for temporary files (java.io.tmpdir) Note the inclusion of shared in the CATALINA_BASE set. It would be better if it read For classes and resources that must be shared across all web applications within this Tomcat instance. Was that feature changed in the 5.0 and later versions? My 4.1.x version allows me to put files into $CATALINA_HOME/common/lib and have them available to all webapps which are deployed in their own CATALINA_BASE's. (Hmm... I appear to have TOMCAT_HOME and not CATALINA_HOME in all my scripts.. That's odd.) It sounds like TC 5 only shares TC code, and what David wants to do must be done by either putting his shared libraries in CATALINA_BASE/shared/lib for all his different projects or by symlinking them all together back to CATALINA_HOME/shared/lib. Any reason this was changed? I thought it was great just the way it was. ;) - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFffwF9CaO5/Lv0PARAhwqAJ0S8Kro+saNDpdyVMGIwQq8W0W4tACfXDbS WZuhQTbVij1vCLqU5Li2vIg= =rZLp -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Deploying shared .jar's
Larry Isaacs wrote: Hi Dave, I believe one of the primary reasons that the conf/catalina.properties file exists is so things like this are configurable. If: shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar doesn't do what you want, change it to: shared.loader=${catalina.home}/shared/classes,${catalina.home}/shared/lib/*.jar or something else that achieves your goal. D'oh Why didn't I think of that??? Cheers, Larry -Original Message- From: David Kerber [mailto:[EMAIL PROTECTED] Sent: Monday, December 11, 2006 6:55 PM To: Tomcat Users List Subject: Re: Deploying shared .jar's Caldarale, Charles R wrote: From: David Kerber [mailto:[EMAIL PROTECTED] Subject: Re: Deploying shared .jar's With the way I read it now, anything I try to put under catalina_home/shared/lib won't be visible to the webapps in the various catalina_base folders. Is this correct? Yes. Look at RUNNING.txt in your Tomcat installation directory. To quote from it: When you use this -Dcatalina.base=$CATALINA_BASE argument, Tomcat will calculate all relative references for files in the following directories based on the value of $CATALINA_BASE instead of $CATALINA_HOME: * conf - Server configuration files (including server.xml) * logs - Log and output files * shared - For classes and resources that must be shared across all web applications * webapps - Automatically loaded web applications * work - Temporary working directories for web applications * temp - Directory used by the JVM for temporary files (java.io.tmpdir) Note the inclusion of shared in the CATALINA_BASE set. It would be better if it read For classes and resources that must be shared across all web applications within this Tomcat instance. Yes, that's what I decided on re-reading it for the umpteenth time, when I couldn't get it to work the way I wanted. A bit of clarification by the doc writers might be in order. Dave - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]