aspose file tools*
The moose likes Tomcat and the fly likes Tomcat classes in jar in libs doesn't work Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat classes in jar in libs doesn Watch "Tomcat classes in jar in libs doesn New topic
Author

Tomcat classes in jar in libs doesn't work

Allen Williams
Ranch Hand

Joined: Sep 04, 2006
Posts: 136
When I put all my classes "exploded" under WEB-INF/classes, no problem. Then, I jar 'em up, put the jar under WEB-INF/lib, and tomcat can't find them. Am I supposed to do something special to the jar when it's put into tomcat like this?

TIA


-------<br />Thanks & regards,<br />anw
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61764
    
  67

Always works for me. Are you sure that your jar is correctly formatted with regards to package structure?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Allen Williams
Ranch Hand

Joined: Sep 04, 2006
Posts: 136
Thanks for the reply!

The jar file is located in WEB-INF/lib. It is named the same name as the webapp, i. e., infoisland.jar, where infoisland is the name of the webapp. There are three packages: infoisland, utils, and dbUtils. So, in my development dirs the classes are infoisland/user, infoisland/request, utils/login, dbUtils/dbaccess, etc. Then, what I did, was just to jar them up from the next highest directory using a relative directory: "jar -cvf infoisland.jar .", so the classes are saved like infoisland/user.class, etc. I was wondering if this is right, or if I need a META-INF of some sort. If I just copy the structure under WEB-INF/classes, it works find.

Thanks.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18987
    
    8

Have you considered looking inside the jar file to see what its actual directory structure is? You can do that with any program that lets you inspect zip files (such as WinZip).
Allen Williams
Ranch Hand

Joined: Sep 04, 2006
Posts: 136
Doesn't jar -tvf <jarfile> do that, too? Here's what jar says:

0 Sat Feb 03 22:23:38 EST 2007 META-INF/
71 Sat Feb 03 22:23:38 EST 2007 META-INF/MANIFEST.MF
0 Fri Feb 02 18:10:18 EST 2007 dbMgr/
18295 Sat Feb 03 22:22:52 EST 2007 dbMgr/dbUtils.class
4308 Sat Feb 03 22:22:50 EST 2007 dbMgr/register.class
4148 Sat Feb 03 22:22:50 EST 2007 dbMgr/topicsAdmin.class
1433 Sat Feb 03 22:22:50 EST 2007 dbMgr/TopicUpdate.class
5299 Sat Feb 03 22:22:50 EST 2007 dbMgr/topTag.class
2839 Sat Feb 03 22:22:50 EST 2007 dbMgr/UserUpdate.class
0 Fri Feb 02 18:10:18 EST 2007 infoIsland/
5985 Sat Feb 03 22:22:52 EST 2007 infoIsland/user.class
4689 Sat Feb 03 22:22:52 EST 2007 infoIsland/tribe.class
1307 Sat Feb 03 22:22:52 EST 2007 infoIsland/subtopic.class
3898 Sat Feb 03 22:22:52 EST 2007 infoIsland/request.class
1605 Sat Feb 03 22:22:52 EST 2007 infoIsland/subscription.class
1944 Sat Feb 03 22:22:52 EST 2007 infoIsland/reqtype.class
1653 Sat Feb 03 22:22:52 EST 2007 infoIsland/reqstatus.class
3023 Sat Feb 03 22:22:52 EST 2007 infoIsland/UserMenu.class
2624 Sat Feb 03 22:22:52 EST 2007 infoIsland/login.class
2830 Fri Feb 02 18:10:18 EST 2007 infoIsland/NewTribe.class
8640 Sat Feb 03 22:22:52 EST 2007 infoIsland/ReqMgr.class
6867 Sat Feb 03 22:22:52 EST 2007 infoIsland/ReqTag.class
3501 Sat Feb 03 22:22:52 EST 2007 infoIsland/TribeMgr.class
610 Sat Feb 03 22:22:52 EST 2007 infoIsland/ReqMgr$1.class
3899 Sat Feb 03 22:22:52 EST 2007 infoIsland/CheckUser.class
4977 Sat Feb 03 22:22:52 EST 2007 infoIsland/Client.class
0 Fri Feb 02 18:10:18 EST 2007 utils/
1367 Sat Feb 03 22:22:52 EST 2007 utils/ListBuilder.class
2297 Sat Feb 03 22:22:52 EST 2007 utils/logger.class
748 Sat Feb 03 22:22:52 EST 2007 utils/menuitem.class
2205 Sat Feb 03 22:22:48 EST 2007 utils/MenuTag.class
3402 Fri Feb 02 18:10:18 EST 2007 utils/Client.class

Thanks,
Allen
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat classes in jar in libs doesn't work