JPA persistence.xml META-INF放置文件夹
目前我的persistence.xml位于src/main/resources/META-INF/persistence.xml中。我还使用eclipselink 2.4作为我的JPA2.0实现 发布到服务器并尝试在浏览器中运行应用程序后,我遇到以下错误:JPA persistence.xml META-INF放置文件夹,jpa,jpa-2.0,eclipselink,eclipse-wtp,persistence.xml,Jpa,Jpa 2.0,Eclipselink,Eclipse Wtp,Persistence.xml,目前我的persistence.xml位于src/main/resources/META-INF/persistence.xml中。我还使用eclipselink 2.4作为我的JPA2.0实现 发布到服务器并尝试在浏览器中运行应用程序后,我遇到以下错误: Exception: : java.lang.IllegalArgumentException: No persistence unit named 'X' is available in scope Webapp. Available p
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安装以构建war文件,META-INF文件夹将正确地放置在WEB-INF/classes/META-INF/persistence.xml中(在war内部)。似乎这只是在Eclipse中构建和运行webapp的时间和问题。有人能解释一下吗
有人能解释问题出在哪里吗?也许有人以前遇到过这个问题?您是使用m2eclipse在eclipse中构建war,还是直接通过eclipse构建war?我使用了M2E-WTP插件。右键单击项目->运行方式->Maven安装。