我在eclipse中收到以下错误:
Im getting the following error in eclipse:
persistence.xml文件没有可识别的内容。
The persistence.xml file does not have recognized content.
我的persistence.xml文件在我的应用程序中运行良好,但eclipse不断给我这个错误。移动文件并使用m2eclipse更新我的项目配置后,我得到了这个。我没有更改文件本身。有人知道如何解决这个问题吗?
My persistence.xml file works great in my application but eclipse keeps giving me this error. I got this after moving the file and updating my project configuration with m2eclipse. I did not change the file itself. Anyone knows how to solve this?
persistence.xml:
persistence.xml:
<?xml version="1.0" encoding="UTF-8"?> <persistence version="2.0" xmlns="java.sun/xml/ns/persistence" xmlns:xsi="www.w3/2001/XMLSchema-instance" xsi:schemaLocation="java.sun/xml/ns/persistence java.sun/xml/ns/persistence/persistence_2_0.xsd"> <persistence-unit name="localDB" transaction-type="RESOURCE_LOCAL"> <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider> <class>package.Users</class> <properties> <!-- enable warnings for debugging --> <property name="openjpa.Log" value="DefaultLevel=TRACE, Runtime=INFO, Tool=INFO, SQL=TRACE"/> <!-- connection properties --> <property name="openjpa.ConnectionURL" value="jdbc:mysql://localhost/test"/> <property name="openjpa.ConnectionDriverName" value="com.mysql.jdbc.Driver"/> <property name="openjpa.ConnectionUserName" value="root"/> <property name="openjpa.ConnectionPassword" value=""/> </properties> </persistence-unit> </persistence>更新
看起来m2eclipse中的一个错误与jpa结合使用。
Looks like a bug in m2eclipse in combination with jpa.
bugs.eclipse/bugs/show_bug.cgi?id=251323
暂时解决设置选项将其显示为警告而不是错误
Temporarily solved by setting the option to show it as a warning instead of an error
推荐答案我通过以下方式解决了问题(我正在使用RAD v8.5.1):
I fixed the problem the following way (I'm using RAD v8.5.1):
更多推荐
Eclipse无法识别persistence.xml的内容
发布评论