This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Tomcat and the fly likes jar file not accessible in war file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "jar file not accessible in war file" Watch "jar file not accessible in war file" New topic
Author

jar file not accessible in war file

hari ashok
Greenhorn

Joined: Feb 25, 2004
Posts: 2
I am a beginner to web application. I created a web application and the root folder is OBMS within which i had subfolders JSP, SRC, WEB-INF. In WEB-INF i had CLASSES,LIB folder and WEB.XML file. I placed a mysqlconnector jar file in the LIB folder since i am using mysql database with jsp. Then i created the war file OBMS.WAR with this contents. When i extracted this war file in another system, things are working except the jar file in the LIB folder is not identified. Should that jar file be mentioned in WEB.XML or any other procedure.
Pls,Let me know.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15950
    
  19

Actually, I recommend placing database driver jars in the Tomcat/common/lib directory and not in the webapp. Firstly because it makes things a little more portable and second because it makes the driver available to any other webapps as well.
However, to make classes in a jar usable by a webapp (assuming you don't place them in a shared lib directory), the place to put them is WEB-INF/lib. Capitalization is critical. It's not WEB-INF/Lib or WEB-INF/LIB or even Web-Inf/lib. Windows lets you be sloppy with filename capitalization, but Java doesn't.
So the full path would be something like:
C:\Tomcat4\webapps\mywebapp\WEB-INF\lib\mysql-connector.jar


Customer surveys are for companies who didn't pay proper attention to begin with.
hari ashok
Greenhorn

Joined: Feb 25, 2004
Posts: 2
test
 
 
subject: jar file not accessible in war file
 
Similar Threads
JSF with Weblogic 8.1 sp3
creating a ear file around a war file
deployment
How to deploy a JSP file in WL Managed Server
Compilation error while building the project using Ant