質問

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