• 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

Third Party libraries in Tomcat

 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am using Tomcat for my application. My application has to display images so we are using javachart. As per the instructions, I have made classpath point to a jar file which has all the libraries for the javachart. so, I have no problems compiling a java file with chart library classes. But does Tomcat understand the system classpath? or do I need to specify some where so that tomcat understands that jar. I have put this jar file in tomcat-home/common/lib. But when I run the application, I get the exception NoClassDefFound for this javachart class.
How should I tell the tomcat to look into this jar file?
regards,
Padma.
 
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It should be enough to put the jar file in the web application's lib folder.
'<tomcat_location>/webapps/<web_application>/WEB-INF/lib'
Rene
 
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
Jars that are specific to a single web app should be placed in that app's WEB-INF/lib folder (as per pervious post). For jars that will be shared across more than one app, I place them in $CATALINE_HOME/shared/lib.
bear
 
Padma Prasad
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Rene and Bear.
This also works by placing the jar in the $CATALINE_HOME/common/lib.
Thanks for the help.
Padma.
 
Padma Prasad
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
continuation to my previous reply...........
It works fine if the third party jar file is placed in the $CATALINE_HOME/common/lib. I tried this before but got an error coz I placed a wrong jar file. My mistake............
 
When you have exhausted all possibilities, remember this: you haven't - Edison. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic