tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Pastoor <epast...@vt.edu>
Subject Building a more efficient war file
Date Thu, 21 Jan 2010 17:21:48 GMT
I run a tomcat based website which run about 10 sports leagues.  All of the leagues have their
own war based webapp.   For the last 6 years or so I've been building 10 separate large war
files or one for each. Each deployed webapp contains all the same source code copied across
each.

I have been trying to think of a better way to do this. The only difference in each webapp
is the contents of the META-INF/context.xml which contains specific data about what database
to connect to. Everything else is the same.

I began thinking a better way to do this would be to build a new jar file and store it in
my 

tomcat/common/lib 

directory along with all of my other shared libraries. Then my custom classes would only need
to exist once.

Then each of my 10 WAR files would look like this:
META-INF/
META-INF/MANIFEST.MF
WEB-INF/
WEB-INF/web.xml
WEB-INF/classes/
WEB-INF/classes/log4j.properties
error/
error/notfound.html
META-INF/context.xml

As you can see, this would leave my classes directory empty since everything is now stored
in the new jar file in my common/lib directory.
I've tried this though and it doesn't seem to work. None of the referenced classes in my new
common/lib/ jar file are found when referenced by my web.xml file.

I've googled thing such as "war file without classes", etc and came up empty.

Am I going about this totally wrong?  Is it possible to have my own jar file of classes shared
across all 10 of my webapps?


Thanks  a lot for any help.
Eric
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message