The project does not contain a persistence unit

#1

How do I fix this error/warning that Netbeans gives me?

  No Persistence Unit

#2

ObjectDB itself does not require a persistence unit, but NetBeans produces this warning because a persistence unit is required by JPA.

Although your application should work well with ObjectDB with no persistence unit, you may have to add a persistence unit definition in a persistence.xml file to your project, in order to remove this NetBeans warning.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
#3

The warning doesn't seem to go away after placing persistence.xml into META-INF and cleaning and building?

#4

Maybe the META-INF directory is not in the right place.

See the Java EE / JPA / Netbeans tutorial.

This page in the tutorial explains how to add a persistence unit.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

Post Reply

To post a reply and/or subscribe to update notifications - please login