No Persistence provider for EntityManager named

前端 未结 30 2535
甜味超标
甜味超标 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:32

    In my case, previously I use idea to generate entity by database schema, and the persistence.xml is automatically generated in src/main/java/META-INF,and according to https://stackoverflow.com/a/23890419/10701129, I move it to src/main/resources/META-INF, also marked META-INF as source root. It works for me.

    But just simply marking original META-INF(that is, src/main/java/META-INF) as source root, doesn't work, which confuses me.

    and this is the structre:

提交回复
热议问题