JPA persistence.xml META-INF放置文件夹

时间:2013-06-17 15:49:20

标签: jpa jpa-2.0 eclipselink eclipse-wtp persistence.xml

我目前的persistence.xml位于src / main / resources / META-INF / persistence.xml中。我也使用eclipselink 2.4作为我的JPA 2.0实现。

enter image description here

发布到服务器并尝试在浏览器中运行应用程序后,我收到以下错误:

Exception: : java.lang.IllegalArgumentException: No persistence unit named 'X'
is available in scope Webapp. Available persistence units: [] at

仅在Eclipse中构建时才这样做。将META-INF留在路径src / main / resources / META-INF / persistence.xml并执行maven install以构建war文件,META-INF文件夹正确放置在WEB-INF / classes / META-INF / persistence中像它应该是.xml(在战争中)。似乎只是在Eclipse中构建和运行webapp的时间和问题。谁能解释一下呢?

任何人都可以解释问题是什么吗?也许有人之前遇到过这个问题?

0 个答案:

没有答案
相关问题