Eclipse does not recognize content of persistence.xml

前端 未结 27 1738
野趣味
野趣味 2021-01-30 20:44

Im getting the following error in eclipse:

The persistence.xml file does not have recognized content.

My persistence.xml file works great in my application but e

27条回答
  •  抹茶落季
    2021-01-30 21:09

    I am using eclipse mars and had this same exact error. What I had to do was 1 set the version of jpa for the project facet. right click project -> Properties -> Project Facets Set version of jpa to 2.1 in my case.

    Note: Just configuring the jpa project facet will not remove the error. You also need to configure the platform.

    Next I had to configure the JPA platform. right click project -> Properties -> JPA. Change platoform to be Hibernate 2.1 in my case.

    This problem also manifests itself when you open the persistence.xml with the Persistence XML Editor and you only have a single Source tab at the bottom and not the other tabs for General, Connection, Options, Properties etc.

提交回复
热议问题