Search code examples
javaeclipsetomcatobjectdb

ObjectDB EntityManager not found


I'm working with Tomcat, Eclipse and Maven. I added the ObjectDB to the project (libraries > add external jar).

In Eclipse everything seems to be okay. It does not show any "not found" errors and the autocomplete works. But when I run the project it shows this error message:

Ljavax/persistence/EntityManager;

viewId=/login.xhtml
location=...
phaseId=RENDER_RESPONSE(6)

Caused by:
java.lang.ClassNotFoundException - javax.persistence.EntityManager
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)

Is anything wrong with my implementation?


Solution

  • The exception indicates that ObjectDB is not in the Tomcat / web application classpath (although it may be in the classpath that is used by the compiler).

    Try to add it to the web application classpath (see this tutorial) or at the server (Tomcat) level.