Eclipse - How to fix error "No persistence.xml file found in project" JPA issue
Asked Answered
F

1

17

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

Forego answered 17/7, 2013 at 9:0 Comment(1)
Possible duplicate of How to tell eclipse to ignore: "No persistence.xml file found in project"Widdershins
D
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

Dosia answered 17/7, 2013 at 9:9 Comment(2)
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.)Forego
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?Silicate

© 2022 - 2024 — McMap. All rights reserved.