Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl cannot be
java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl cannot be [message #386586] Fri, 03 April 2009 12:23 Go to next message
Tom Eugelink is currently offline Tom EugelinkFriend
Messages: 807
Registered: July 2009
Senior Member
I'm currently trying to retrofit an existing BM with JPA and I did something wrong. But the exception doesn't really help me determine what. Eclipse 1.1.


BUILD FAILED
Local Exception Stack:
Exception [EclipseLink-40007] (Eclipse Persistence Services - 1.1.0.r3634): org.
eclipse.persistence.exceptions.StaticWeaveException
Exception Description: An exception was thrown while weaving: ../KPProfilerEngin
e.jar
Internal Exception: java.lang.ClassCastException: sun.reflect.generics.reflectiv
eObjects.ParameterizedTypeImpl cannot be cast to java.lang.reflect.TypeVariable
at org.eclipse.persistence.exceptions.StaticWeaveException.exce ptionPerf
ormWeaving(StaticWeaveException.java:138)
at org.eclipse.persistence.tools.weaving.jpa.StaticWeaveAntTask .start(St
aticWeaveAntTask.java:206)
at org.eclipse.persistence.tools.weaving.jpa.StaticWeaveAntTask .execute(
StaticWeaveAntTask.java:168)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.j ava:288)
Re: java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl canno [message #386589 is a reply to message #386586] Fri, 03 April 2009 12:24 Go to previous messageGo to next message
Tom Eugelink is currently offline Tom EugelinkFriend
Messages: 807
Registered: July 2009
Senior Member
There was more:

BUILD FAILED
Local Exception Stack:
Exception [EclipseLink-40007] (Eclipse Persistence Services - 1.1.0.r3634): org.
eclipse.persistence.exceptions.StaticWeaveException
Exception Description: An exception was thrown while weaving: ../KPProfilerEngin
e.jar
Internal Exception: java.lang.ClassCastException: sun.reflect.generics.reflectiv
eObjects.ParameterizedTypeImpl cannot be cast to java.lang.reflect.TypeVariable
at org.eclipse.persistence.exceptions.StaticWeaveException.exce ptionPerf
ormWeaving(StaticWeaveException.java:138)
at org.eclipse.persistence.tools.weaving.jpa.StaticWeaveAntTask .start(St
aticWeaveAntTask.java:206)
at org.eclipse.persistence.tools.weaving.jpa.StaticWeaveAntTask .execute(
StaticWeaveAntTask.java:168)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.j ava:288)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(Dispatch Utils.jav
a:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.ja va:1337)
at org.apache.tools.ant.Project.executeTarget(Project.java:1306 )
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(D efaultExe
cutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:118 9)
at org.apache.tools.ant.Main.runBuild(Main.java:758)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
Caused by: java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.
ParameterizedTypeImpl cannot be cast to java.lang.reflect.TypeVariable
at org.eclipse.persistence.internal.jpa.metadata.accessors.obje cts.Metad
ataAnnotatedElement.getReferenceClassFromGeneric(MetadataAnn otatedElement.java:2
52)
at org.eclipse.persistence.internal.jpa.metadata.accessors.obje cts.Metad
ataAnnotatedElement.isOneToMany(MetadataAnnotatedElement.jav a:422)
at org.eclipse.persistence.internal.jpa.metadata.accessors.clas ses.Class
Accessor.buildAccessor(ClassAccessor.java:271)
at org.eclipse.persistence.internal.jpa.metadata.accessors.clas ses.Class
Accessor.processAccessorFields(ClassAccessor.java:577)
at org.eclipse.persistence.internal.jpa.metadata.accessors.clas ses.Class
Accessor.addAccessors(ClassAccessor.java:239)
at org.eclipse.persistence.internal.jpa.metadata.accessors.clas ses.Class
Accessor.processAccessors(ClassAccessor.java:633)
at org.eclipse.persistence.internal.jpa.metadata.accessors.clas ses.Entit
yAccessor.processAccessors(EntityAccessor.java:611)
at org.eclipse.persistence.internal.jpa.metadata.accessors.clas ses.Entit
yAccessor.process(EntityAccessor.java:530)
at org.eclipse.persistence.internal.jpa.metadata.MetadataProces sor.proce
ssORMMetadata(MetadataProcessor.java:446)
at org.eclipse.persistence.internal.jpa.deployment.PersistenceU nitProces
sor.processORMetadata(PersistenceUnitProcessor.java:303)
at org.eclipse.persistence.tools.weaving.jpa.StaticWeaveClassTr ansformer
..buildTransformer(StaticWeaveClassTransformer.java:156)
at org.eclipse.persistence.tools.weaving.jpa.StaticWeaveClassTr ansformer
..buildClassTransformers(StaticWeaveClassTransformer.java:12 6)
at org.eclipse.persistence.tools.weaving.jpa.StaticWeaveClassTr ansformer
..<init>(StaticWeaveClassTransformer.java:81)
at org.eclipse.persistence.tools.weaving.jpa.StaticWeaveProcess or.proces
s(StaticWeaveProcessor.java:237)
at org.eclipse.persistence.tools.weaving.jpa.StaticWeaveProcess or.perfor
mWeaving(StaticWeaveProcessor.java:161)
at org.eclipse.persistence.tools.weaving.jpa.StaticWeaveAntTask .start(St
aticWeaveAntTask.java:203)
... 17 more
Re: java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl canno [message #386596 is a reply to message #386589] Mon, 06 April 2009 14:07 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

Please log a bug for this issue and include your class definition.

It is most likely occurring because of your usage of generics. Removing
the generics or marking the field/property with @Transient will probably
workaround the issue.

---
James
http://www.nabble.com/EclipseLink---Users-f26658.html


James : Wiki : Book : Blog : Twitter
Previous Topic:When Oracle converts empty string to null, does EclipseLink cache reflect that?
Next Topic:How to configure buildSelectQueryForIdentity()
Goto Forum:
  


Current Time: Sun Nov 23 21:18:55 GMT 2014

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

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