2
votes

I get this error trying to run web app on tomcat in eclipse:

SEVERE: Allocate exception for servlet Kartoteka java.lang.ClassNotFoundException: org.hibernate.criterion.Criterion at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526) at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Unknown Source) at java.lang.Class.getConstructor0(Unknown Source) at java.lang.Class.newInstance0(Unknown Source) at java.lang.Class.newInstance(Unknown Source) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1149) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:827) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Unknown Source)

It seems that there's no specific library but I have no idea which exactly. I use last hibernate version(4.1.8 final). I've tried to link all libraries from hiberante but it doesn't help. Any suggestions?

1

1 Answers

0
votes

The JAR file(s) with webapp's runtime dependencies have to go in /WEB-INF/lib folder. The exception which you're facing suggests that this is not the case. So, to fix it all you have just to make sure that the JAR file(s) are been dropped in the right place.

A common beginner's mistake is that they fiddle in the Build Path property of the project in order to add runtime dependencies. That's thus wrong. It only adds compile time dependencies. You need to undo every change which you made in there in an attempt to solve this problem, or it may still collide.