Manoj
Manoj

Reputation: 329

Difference between keeping jar files in WAR and Tomcat lib folder

I have web application. I want Eclipse BIRT reports in that application. Tomcat is not even started by memory error if i add BIRT jar files into Tomcat lib.

If build WAR with that jars only application runs

What is the difference and what is the problem behind this?

Upvotes: 0

Views: 2534

Answers (2)

Wand Maker
Wand Maker

Reputation: 18762

Jars in Tomcat/libs are visible to all WAR files.

Generally there is no need to place JARs in Tomcat/libs. Only time one would do this is when your WAR file is very big (say 50 MB+) and bulk of it is third-party JARs. In such cases, you can move all the JARs that are not part of your source code like Spring, Hibernate, etc. and move them to Tomcat/Lib and deploy a much light-weight WARs. This may be needed only for Staging/Test/Production systems.

Upvotes: 3

David Hofmann
David Hofmann

Reputation: 5775

All the jars within the $TOMCAT/lib directory are visible to all the web applications deployed to tomcat. Where as the jars inside your war are only visible to the web application contained in the war.

You normally would place the birt engine libraries inside your tomcat lib. But the actual reports and the code that excecutes your reports will be in your war.

If you have problems starting tomcat if you have the birt engine jars in the lib directory of tomcat, then that is another story. You can show the errors you have so we can see how to fix it.

Upvotes: 0

Related Questions