I'm trying to use jpa in a desktop application. I keep getting the error No Persistence provider for EntityManager named <unit>
and I suspect that my persistence.xml cannot be located.
I've placed it in the <project>/src/META-INF/persistence.xml
I have the feeling that jpa cannot find this file, but I do not known how to troubleshoot.
How can I specify where the persistence.xml file is stored and how can I check if it is actually read?
Stacktrace:
javax.persistence.PersistenceException: No Persistence provider for EntityManager named myunit
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:69)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47)
at myapplication.MyEntity.testAddEntity(HistoryAction.java:85)