Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 44749 invoked from network); 25 Mar 2011 14:47:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 25 Mar 2011 14:47:46 -0000 Received: (qmail 41126 invoked by uid 500); 25 Mar 2011 14:47:46 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 41087 invoked by uid 500); 25 Mar 2011 14:47:46 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 41079 invoked by uid 99); 25 Mar 2011 14:47:46 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Mar 2011 14:47:46 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Mar 2011 14:47:43 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id C032B4D22B for ; Fri, 25 Mar 2011 14:47:05 +0000 (UTC) Date: Fri, 25 Mar 2011 14:47:05 +0000 (UTC) From: "Rick Curtis (JIRA)" To: dev@openjpa.apache.org Message-ID: <1757257376.11369.1301064425783.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Created] (OPENJPA-1965) ClassCastException when using JAXB and MetaModel annotation processor MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org ClassCastException when using JAXB and MetaModel annotation processor --------------------------------------------------------------------- Key: OPENJPA-1965 URL: https://issues.apache.org/jira/browse/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: com.sun.tools.javac.code.Symbol$PackageSymbol cannot be cast to javax.lang.model.element.TypeElement [javac] at org.apache.openjpa.persistence.meta.AnnotationProcessor6.process(AnnotationProcessor6.java:207) [javac] at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:625) [javac] at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:554) [javac] at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:699) [javac] at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:981) [javac] at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:727) [javac] at com.sun.tools.javac.main.Main.compile(Main.java:353) [javac] at com.sun.tools.javac.main.Main.compile(Main.java:279) [javac] at com.sun.tools.javac.main.Main.compile(Main.java:270) [javac] at com.sun.tools.javac.Main.compile(Main.java:69) [javac] at com.sun.tools.javac.Main.main(Main.java:54) .... ----- Details on how to recreate : .... Hi, 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) 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: http://www.atlassian.com/software/jira