aspose file tools*
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 Spring in Action this week in the Spring 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: 16145
    
  21

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