No Persistence provider for EntityManager named

前端 未结 30 2012
甜味超标
甜味超标 2020-11-22 03:45

I have my persistence.xml with the same name using TopLink under the META-INF directory. Then, I have my code calling it with:

30条回答
  •  长情又很酷
    2020-11-22 04:37

    In an OSGi-context, it's necessary to list your persistence units in the bundle's MANIFEST.MF, e.g.

    JPA-PersistenceUnits: my-persistence-unit
    

    Otherwise, the JPA-bundle won't know your bundle contains persistence units.

    See http://wiki.eclipse.org/EclipseLink/Examples/OSGi/Developing_with_EclipseLink_OSGi_in_PDE .

提交回复
热议问题