Eclipse - How to fix error “No persistence.xml file found in project” JPA issue

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-30 04:00:09

问题


Error "No persistence.xml file found in project" in Eclipse.

Aim: Create a new project GWT+App engine+Maven

Steps to create this:

  1. Google eclipse plugin: select "New Web Application Project".
  2. set the name etc.
  3. right-click on the project > Configure > Convert to Maven...
  4. Fix jdoconfig.xml file: xsi has the wrong value. see Validating jdoconfig with incorrect url

Then I get the above error.

The file exists at scr/META-INF/persistence.xml and also war/WEB-INF/classes/META-INF/persistence.xml But is not being found.

Notes: I installed plugins m2e, m2e-wtp and google eclipse plugin


回答1:


If you are using eclipse. Try right clicking the Project File -> Build Path -> Configure Build Path

Step 1: Add the folder META-INF to the build path

Step 2: Right click the Project File -> Maven -> Update Project



来源:https://stackoverflow.com/questions/17695458/eclipse-how-to-fix-error-no-persistence-xml-file-found-in-project-jpa-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!