Eclipse - 如何修复错误“在项目中找不到persistence.xml文件” JPA问题 [英] Eclipse - How to fix error "No persistence.xml file found in project" JPA issue

查看:740
本文介绍了Eclipse - 如何修复错误“在项目中找不到persistence.xml文件” JPA问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



目标:创建一个新的项目GWT +应用程序引擎+ Maven



创建此项的步骤:


  1. Google eclipse插件:选择新建Web应用程序项目。

  2. 设置名称等。

  3. 右键单击项目>配置>
    转换为Maven ...

  4. 修复jdoconfig.xml文件:xsi有错误的
    值。请参阅
    使用不正确的网址验证jdoconfig

然后我收到上述错误。



该文件存在于scr / META-INF / persistence.xml
还有war / WEB-INF / classes / META-INF / persistence.xml
但是没有找到。



注意:我安装插件m2e,m2e-wtp和google eclipse插件

解决方案

如果你正在使用eclipse。
尝试右键单击项目文件 - >构建路径 - >配置构建路径



步骤1:将文件夹META-INF添加到构建路径



步骤2:右键单击项目文件 - > Maven - >更新项目


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

解决方案

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

这篇关于Eclipse - 如何修复错误“在项目中找不到persistence.xml文件” JPA问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆