Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dali » ClassCastException while traversing resources
ClassCastException while traversing resources [message #434553] Mon, 13 August 2007 17:12 Go to next message
Eclipse User
Originally posted by: eclipse.spatula.net

When I start Europa or open the JPA perspective, I get the following
message:

An error occurred while traversing resources. Reason:
org.eclipse.jdt.core.dom.QualifiedName

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)

And here's the session info:

eclipse.buildId=I20070625-1500
java.version=1.5.0_12
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments: -os win32 -ws win32 -arch x86

This is with JPA 1.0 in Eclipse Europa.
Re: ClassCastException while traversing resources [message #434554 is a reply to message #434553] Mon, 13 August 2007 18:29 Go to previous message
Karen Butzke is currently offline Karen Butzke
Messages: 220
Registered: July 2009
Senior Member
I believe you are seeing a bug that has been fixed in the 1.0 maintenance
stream: https://bugs.eclipse.org/bugs/show_bug.cgi?id=196086

Looks like you have code like the following:
@OneToMany(cascade=CascadeType.ALL)
and Dali was only handling
@OneToMany(cascade={CascadeType.ALL})

You can get the latest 2.0.1 webtools build and this will be fixed.
http://download.eclipse.org/webtools/downloads/drops/R2.0/M- 2.0.1-200708012344/

Karen
Re: ClassCastException while traversing resources [message #605366 is a reply to message #434553] Mon, 13 August 2007 18:29 Go to previous message
Karen Butzke is currently offline Karen Butzke
Messages: 220
Registered: July 2009
Senior Member
I believe you are seeing a bug that has been fixed in the 1.0 maintenance
stream: https://bugs.eclipse.org/bugs/show_bug.cgi?id=196086

Looks like you have code like the following:
@OneToMany(cascade=CascadeType.ALL)
and Dali was only handling
@OneToMany(cascade={CascadeType.ALL})

You can get the latest 2.0.1 webtools build and this will be fixed.
http://download.eclipse.org/webtools/downloads/drops/R2.0/M- 2.0.1-200708012344/

Karen
Previous Topic:ClassCastException while traversing resources
Next Topic:Many problems with Dali
Goto Forum:
  


Current Time: Thu Oct 23 00:10:09 GMT 2014

Powered by FUDForum. Page generated in 0.02103 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software