16

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

Community
  • 1
  • 1
eddyparkinson
  • 3,502
  • 4
  • 24
  • 46
  • Possible duplicate of [How to tell eclipse to ignore: "No persistence.xml file found in project"](https://stackoverflow.com/questions/20287026/how-to-tell-eclipse-to-ignore-no-persistence-xml-file-found-in-project) – bakoyaro Aug 18 '17 at 16:26

1 Answers1

20

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

Gerard Downes
  • 633
  • 11
  • 23
  • 3
    Steps that worked: 1. Add the folder META-INF to the build path. 2. right clicking the Project File -> Maven -> Update Project. ..... (I could then remove the folder META-INF from the build path and all was fine. But "Maven -> Update Project", on its own did not work, needed both steps.) – eddyparkinson Jul 18 '13 at 00:01
  • 1
    Is this one of those things one should not ask questions about with Eclipse? I mean: the META-INF/persistence.xml is in the buildpath but the "Maven -> Update Project" still does not remove the message. Or should persistence.xml really be in the root of the classpath? – gkephorus Sep 07 '15 at 08:41