File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes Tomcat cannot find persistence / jar files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat cannot find persistence / jar files" Watch "Tomcat cannot find persistence / jar files" New topic
Author

Tomcat cannot find persistence / jar files

Edward Nunez
Ranch Hand

Joined: Sep 25, 2013
Posts: 39
Hey, I'm trying to reference some persistence objects in a servlet. But, TomCat explodes because "java.lang.ClassNotFoundException: javax.persistence.Persistence". These classes are in my referenced jars and not causing any compilation or runtime problems within my non-server Java classes. I'm not sure what the problem is. Should the Jars be somewhere else too?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41186
    
  45
What do you mean by "referenced jars"? Where are they? WEB-INF/lib would be a good place.


Ping & DNS - my free Android networking tools app
Edward Nunez
Ranch Hand

Joined: Sep 25, 2013
Posts: 39
You know something, that IS a good place. I was expecting TomCat to check my project's lib folder but it does not.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15964
    
  19

Tomcat could care less about your IDE. Your IDE plugs into tomcat, not the other way around.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Tomcat cannot find persistence / jar files
 
Similar Threads
[JSTL] The absolute uri cannot be resolved in either web.xml or the jar files deployed
strange problem with my servlet or web.xml file
Adding persistence.xml dynamically
EJB3 @Stateful generate error
Tomcat webapp redeploy, session state saved, ClassNotFoundException