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
I've had the same problem on a few occasions and what worked for me was to copy the contents of the file, delete it and create a new persistence.xml file and paste the contents back in.
The problem has been fixed in Indigo (released in June 2011), see https://bugs.eclipse.org/bugs/show_bug.cgi?id=251323#c24 and https://issues.sonatype.org/browse/MECLIPSEWTP-11.
The "persistence.xml file does not have recognized content." error might still appear, randomly, on project import or Workspace startup, but it can be fixed with a project clean or maven project update. This will be fixed in Dali in SR2.
For me it worked once I have cleared all messages from Markers tab in eclipse
I fixed the problem the following way (I'm using RAD v8.5.1):
I had this same problem in Eclipse 3.6 (Helios). The cause was the JPA Facet was set to JPA Version 1.0, however my persistence.xml file was specifying JPA Version 2. So I changed the JPA Facet to version 2.0 and the problem went away. (Project --> Properties --> Project Facets --> "Configuration" drop down --> set this to "Minimal JPA 2.0 configuration"
I had the same problem, to make it go away I had to make sure this line was the very first line at the top of the file (with no leading empty lines or spaces):
<?xml version="1.0" encoding="UTF-8"?>