Where to put z*.jar files?

dastultz
797 8

Hello,

I have what amounts to a single application with multiple webapp copies to serve different clients. I have my Zk jar files in myapp/WEB-INF/lib. This means the Zk class definitions take up lots of Permanent Generation space since each set is loaded for each webapp. I originally had my Zk jar files in tomcat/lib folder but recall discovering that some configuration element was global to all webapps. I don't remember what it was. I do in fact have one or two other Zk applications of a different nature, but as far as I know, the Zk configuration (zk.xml? lang-addon.xml?) is the same. Can someone give me a description of the problems I might encounter if I have my Zk jars in tomcat/lib rather than myapp/WEB-INF/lib?

Thanks.

/Daryl

delete retag edit

3 Replies

ashishd
1972 6

Hi dastultz,
zk.xml configuration is per application so if you are using same version of ZK for multiple webapps they can share all z*.jar files and each can have different zk.xml under WEB-INF. But lang-addon.xml is global and shared across all ZK webapps so in case you are using different lang-addon.xml per webapp you can only use z*.jar for each each of them under WEB-INF/lib.

For sharing z*.jar files across put those files under $CATALINA_HOME/shared/lib instead. Here is a text from Tomcat HowTo Note that Tomcat 6.0.14 the$CATALINA_HOME/shared/lib directory does not exist. You will need to add this and you will need to edit $CATALINA_HOME/conf/catalina.properties so that the shared.loader line looks like this shared.loader=$CATALINA_HOME/shared/lib

Let us know if you run into any problem.
Thanks
- Ashish

dastultz
797 8

Thanks for the clarification. So what actually happens when each lang-addon.xml is encountered? Merged? Last one wins? For example, I have a line like so:

<javascript src="/script/core.js" charset="UTF-8"/>

Will this get included in all my apps? I could test this particular thing myself, of course, but I'm looking for info on stuff I don't know about...

>Note that Tomcat 6.0.14 the $CATALINA_HOME/shared/lib directory does not exist. You will need to add this Really? I just pile everything in$CATALINA_HOME/lib. What's the difference?

Thanks.

/Daryl

ashishd
1972 6

@dastultz,
>>So what actually happens when each lang-addon.xml is encountered? Merged? Last one wins?

>>Really? I just pile everything in $CATALINA_HOME/lib. What's the difference? libraries in$CATALINA_HOME/lib are common to Web server and all deployed webapps where as \$CATALINA_HOME/shared/lib are only shared between all deployed webapps. This may not cause much of the problem for most cases but there are some boeder cases such as this one (I believe it shouldn't matter in your case though)

Thanks
- Ashish

[hide preview]