This is on a project which already has a persistence.xml and for which
many Entities were already defined by hand. I added the JPA
natures/facets to it by hand based on the creation of a new JPA project.
That seems to have mostly worked, and I do get the JPA outlines for my
Entities, though not all of the time. Sometimes I also get a red
underline under my @Entity annotation and the error associated with it is
that the entity is not associated with any persistence unit (although it
plainly is in META-INF/persistence.xml and sysinternals.com's Filemon
shows that it was accessed and read). The behaviour here seems to be
somewhat nondeterministic, as sometimes it works and sometimes it doesn't,
with no obvious trigger.

Here's the full stack trace from the error log that causes the error while
traversing resources; perhaps it will be helpful:

java.lang.ClassCastException: org.eclipse.jdt.core.dom.QualifiedName
at
org.eclipse.jpt.core.internal.jdtutility.EnumArrayDeclaratio nAnnotationElementAdapter.resolve(EnumArrayDeclarationAnnota tionElementAdapter.java:91)
at
org.eclipse.jpt.core.internal.jdtutility.EnumArrayDeclaratio nAnnotationElementAdapter.getValue(EnumArrayDeclarationAnnot ationElementAdapter.java:66)
at
org.eclipse.jpt.core.internal.jdtutility.EnumArrayDeclaratio nAnnotationElementAdapter.getValue(EnumArrayDeclarationAnnot ationElementAdapter.java:1)
at
org.eclipse.jpt.core.internal.jdtutility.MemberAnnotationEle mentAdapter.getValue(MemberAnnotationElementAdapter.java:43)
at
org.eclipse.jpt.core.internal.jdtutility.ShortCircuitAnnotat ionElementAdapter.getValue(ShortCircuitAnnotationElementAdap ter.java:47)
at
org.eclipse.jpt.core.internal.content.java.mappings.JavaCasc ade.updateFromJava(JavaCascade.java:574)
at
org.eclipse.jpt.core.internal.content.java.mappings.JavaRela tionshipMapping.updateFromJava(JavaRelationshipMapping.java: 567)
at
org.eclipse.jpt.core.internal.content.java.mappings.JavaMult iRelationshipMapping.updateFromJava(JavaMultiRelationshipMap ping.java:700)
at
org.eclipse.jpt.core.internal.content.java.mappings.JavaAttr ibuteMapping.initialize(JavaAttributeMapping.java:80)
at
org.eclipse.jpt.core.internal.content.java.JavaPersistentAtt ribute.updateFromJava(JavaPersistentAttribute.java:564)
at
org.eclipse.jpt.core.internal.content.java.JavaPersistentTyp e.updatePersistentFields(JavaPersistentType.java:694)
at
org.eclipse.jpt.core.internal.content.java.JavaPersistentTyp e.updatePersistentAttributes(JavaPersistentType.java:677)
at
org.eclipse.jpt.core.internal.content.java.JavaPersistentTyp e.updateFromJava(JavaPersistentType.java:671)
at
org.eclipse.jpt.core.internal.content.java.JpaCompilationUni t.synchronizePersistentTypes(JpaCompilationUnit.java:406)
at
org.eclipse.jpt.core.internal.content.java.JpaCompilationUni t.setFile(JpaCompilationUnit.java:325)
at
org.eclipse.jpt.core.internal.content.java.JavaJpaFileConten tProvider.buildRootContent(JavaJpaFileContentProvider.java:3 0)
at
org.eclipse.jpt.core.internal.JpaFileContentRegistry.buildCo ntent(JpaFileContentRegistry.java:60)
at
org.eclipse.jpt.core.internal.JpaFileContentRegistry.getFile (JpaFileContentRegistry.java:44)
at
org.eclipse.jpt.core.internal.JpaProject.createJpaFile(JpaPr oject.java:630)
at org.eclipse.jpt.core.internal.JpaProject$3.visit(JpaProject. java:497)
at
org.eclipse.core.internal.resources.Resource$1.visitElement( Resource.java:57)
at
org.eclipse.core.internal.watson.ElementTreeIterator.doItera tion(ElementTreeIterator.java:81)
at
org.eclipse.core.internal.watson.ElementTreeIterator.doItera tion(ElementTreeIterator.java:85)
at
org.eclipse.core.internal.watson.ElementTreeIterator.doItera tion(ElementTreeIterator.java:85)
at
org.eclipse.core.internal.watson.ElementTreeIterator.doItera tion(ElementTreeIterator.java:85)
at
org.eclipse.core.internal.watson.ElementTreeIterator.doItera tion(ElementTreeIterator.java:85)
at
org.eclipse.core.internal.watson.ElementTreeIterator.doItera tion(ElementTreeIterator.java:85)
at
org.eclipse.core.internal.watson.ElementTreeIterator.doItera tion(ElementTreeIterator.java:85)
at
org.eclipse.core.internal.watson.ElementTreeIterator.doItera tion(ElementTreeIterator.java:85)
at
org.eclipse.core.internal.watson.ElementTreeIterator.doItera tion(ElementTreeIterator.java:85)
at
org.eclipse.core.internal.watson.ElementTreeIterator.doItera tion(ElementTreeIterator.java:85)
at
org.eclipse.core.internal.watson.ElementTreeIterator.iterate (ElementTreeIterator.java:126)
at org.eclipse.core.internal.resources.Resource.accept(Resource .java:67)
at org.eclipse.jpt.core.internal.JpaProject.fill(JpaProject.jav a:504)
at
org.eclipse.jpt.core.internal.JpaModelManager.fillJpaProject (JpaModelManager.java:180)
at org.eclipse.jpt.core.internal.JpaModel$1.visit(JpaModel.java :152)
at
org.eclipse.core.internal.resources.Resource$1.visitElement( Resource.java:57)
at
org.eclipse.core.internal.watson.ElementTreeIterator.doItera tion(ElementTreeIterator.java:81)
at
org.eclipse.core.internal.watson.ElementTreeIterator.iterate (ElementTreeIterator.java:119)
at org.eclipse.core.internal.resources.Resource.accept(Resource .java:67)
at org.eclipse.jpt.core.internal.JpaModel.fill(JpaModel.java:15 8)
at
org.eclipse.jpt.core.internal.JpaModelManager$WorkspaceBuild Job$1.run(JpaModelManager.java:260)
at org.eclipse.core.internal.resources.Workspace.run(Workspace. java:1797)
at org.eclipse.core.internal.resources.Workspace.run(Workspace. java:1779)
at
org.eclipse.jpt.core.internal.JpaModelManager$WorkspaceBuild Job.run(JpaModelManager.java:257)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)