• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

difference between putting jars in <project>.war/web-inf/lib and Tomcat/lib

 
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I had my jars in <project>.war/Web-inf/lib, but i was getting Classnot found excpetions. Exception were related to "log4j" , "mysql". So, i moved the appropriate jars to Tomcat/lib and it started working. My questions here is that what difference does it make? I basically thought, tomcat classloader looks into 1) web-inf/classes,2) web-inf/lib and 3)tomcat/lib. But, in my case it skipped the web-inf/lib,atleast it appears like that. Any idea why
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you sure you put them in WEB-INF/lib of the application. WEB-INF folder name is case sensitive.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
WEB-INF. Not web-inf. Nor Web-inf. Just WEB-INF.

Putting the jars in tomcat's lib shares them across all apps. Not the best idea except for JDBC drivers participating in container-managed connection pooling.

If your jars aren't working when placed in WEB-INF/lib, something is wrong with the configuration of the app or the IDE project.

[Edit: dang, beat by 26 seconds!]
 
Maan Suraj
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks. basically it was a typo here when posting this query. In the project, it is WEB-INF folder only.Basically, as you mentioned, there seems to be some configuration issue when am building the project from eclipse, as i see that WEB-INF\lib folder is empty. However, if i do a maven build from outside eclipse, then it works fine. Earlier, i got confused between the war generated by eclipse (which is some other default folder) and the one which i generate from mvn build from outside. Having said that, i am still not sure what configuration am i missing in eclipse(since WEB-INF\lib) is empty. Please help
 
Maan Suraj
Ranch Hand
Posts: 299
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
below is the solution.


[google]Project Properties -> Deployment Assembly
Add -> Archives From File System -> Next -> Add
(The file dialog of your system opens up.)
Navigate to the archive you want to include in your WEB-INF/lib, select it and hit OK.
Hit Finish.
Hit OK.[/google]
 
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for sharing the solution! Which IDE do you use (I mean, which IDE are the instructions for)?
 
Maan Suraj
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry for late reply. Above instructions are for Eclipse (helios)
 
We must storm this mad man's lab and destroy his villanous bomb! Are you with me tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic