问题
I am working on a web based project.
When I startup my tomcat server it redirects to an Login HTML page. On click of a login link a JSP Page is called. All the validation is done in the JSP page. Here Hibernate is used to interact with the database.
Problem:
On click of the login link, a ClassNotFoundException for the class MetadataProvider and ReflectionManager is thrown. Both the classes belong to the hibernate-annotations-common jar.
I have tried installing hibernate by updating my eclipse, by manually downloading the jar files and adding it to the web-inf/lib folder but still the same exception pops up.
Has it got anything to do with eclipse indigo 64 bit/windows 7 64 bit/tomcat 7? I found out previously that the eclipse is different for 32 bit and 64 bit. Is it the same for hibernate?
Added all the jars to the run configurations of the project and to my surprise it worked. I was of the opinion that the jars are pickup from the web-inf library. But I removed all the jars from there and added it on the run configurations and it works.
In the precious application I worked the jars were there in the web-inf lib folder and the run configurations had only the tomcat jars and it still worked. How was that possible?
来源:https://stackoverflow.com/questions/10598504/configuring-hibernate-in-eclipse-indigo