The project does not contain a persistence unit

#1

How do I fix this error/warning that Netbeans gives me regarding 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
#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

Reply