Jump to Navigation

ejb3

JPA Detached Object Gotchas

Java Persistence API detached object gotchas

One of the issues to get your head around in both Hibernate and JPA is how to handle detached entities. In Hibernate one has to deal with the session object and in JPA it is called the persistence context.

Java: 

Cannot find the declaration of element 'persistence'

A common error when using EJB3 is

Cannot find the declaration of element 'persistence'

This is caused by a missing xml namespace attribute declaration in your persistence.xml file. To fix this error make sure your persistence tag has the following syntax:

<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">

instead of

<persistence>

Java: 
Subscribe to RSS - ejb3


by Dr. Radut.