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?

有帮助吗?

解决方案

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.

其他提示

Do yourself a favor and add this to your repositories in maven:

<repository>
  <id>objectdb</id>
  <name>ObjectDB Repository</name>
  <url>http://m2.objectdb.com</url>
</repository>

And add this to your dependencies:

<dependency>
  <groupId>com.objectdb</groupId>
  <artifactId>objectdb</artifactId>
  <version>2.5.6_02</version>
</dependency>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top