Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat classes in jar in libs doesn't work

 
Allen Williams
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64632
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Always works for me. Are you sure that your jar is correctly formatted with regards to package structure?
 
Allen Williams
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Pie
Posts: 20771
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic