0

Where to put z*.jar files?

asked 2010-05-07 10:09:18 +0800

dastultz gravatar image 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 flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2010-05-11 20:29:26 +0800

ashishd gravatar image ashishd flag of Taiwan
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

link publish delete flag offensive edit

answered 2010-05-12 10:50:17 +0800

dastultz gravatar image 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

link publish delete flag offensive edit

answered 2010-05-18 03:02:10 +0800

ashishd gravatar image ashishd flag of Taiwan
1972 6

@dastultz,
>>So what actually happens when each lang-addon.xml is encountered? Merged? Last one wins?
First lang-addon.xml is read and any subsequent lang-addon.xml will be ignored (given both the webapps are loaded by same classloader) I would not recommend sharing z*.jar files if your lang-addon.xml is different.

>>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

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2010-05-07 10:09:18 +0800

Seen: 300 times

Last updated: May 18 '10

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More