openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Curtis (JIRA)" <>
Subject [jira] [Created] (OPENJPA-1965) ClassCastException when using JAXB and MetaModel annotation processor
Date Fri, 25 Mar 2011 14:47:05 GMT
ClassCastException when using JAXB and MetaModel annotation processor

                 Key: OPENJPA-1965
             Project: OpenJPA
          Issue Type: Bug
          Components: tooling
    Affects Versions: 2.1.0, 2.0.0, 2.2.0
            Reporter: Rick Curtis
            Assignee: Rick Curtis
             Fix For: 2.1.1, 2.2.0

This is a problem that was reported by Marc Logemann on the users mailing list. Details from
the email exchange:
So i see a lot of metamodel classes got generated but during this process i got this:

   [javac] An annotation processor threw an uncaught exception.
   [javac] Consult the following stack trace for details.
   [javac] java.lang.ClassCastException:$PackageSymbol cannot
be cast to javax.lang.model.element.TypeElement
   [javac]     at org.apache.openjpa.persistence.meta.AnnotationProcessor6.process(
   [javac]     at
   [javac]     at
   [javac]     at
   [javac]     at
   [javac]     at
   [javac]     at
   [javac]     at
   [javac]     at
   [javac]     at
   [javac]     at

Details on how to recreate :

this is nearly impossible because its not an Entity which makes the problem here. Its a package.
I have no idea how to unit test that. Perhaps you can try creating
a simple package with JAXB generated classes in it and try to reproduce:

1) create a very simple XSD file
2) run the JAXB compiler via ANT (then you should have some classes in myweirdpackage)

   <target name="JAXBCompiling" description="Compile main source tree java files">
       <taskdef name="xjc" classname="" classpathref="toolingclasspath"/>

       <xjc schema="my.xsd" destdir="${src.dir}"  package="domain.myweirdpackage"/>

3) put at least one Entity in domain package (parent of myweirdpackage)
4) run the MetaModel compiling step

This message is automatically generated by JIRA.
For more information on JIRA, see:

View raw message