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

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

问题描述

Eclipse 中的错误在项目中找不到持久性.xml 文件".

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

目的:新建项目GWT+App引擎+Maven

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

创建步骤:

  1. Google eclipse 插件:选择New Web Application Project".
  2. 设置名称等
  3. 右键单击项目 > 配置 >转换为 Maven...
  4. 修复 jdoconfig.xml 文件:xsi 有错误价值.看使用不正确的 url 验证 jdoconfig

然后我得到上述错误.

该文件存在于 scr/META-INF/persistence.xml还有war/WEB-INF/classes/META-INF/persistence.xml但没有被发现.

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

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

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

推荐答案

如果您使用的是 Eclipse.尝试右键单击项目文件 -> 构建路径 -> 配置构建路径

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

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

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

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

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

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

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