Re: MetaModel creation with -Aopenjpa.generate=true
Marc - This problem is fixed[1] in the 2.1.x stream and trunk. [1] http://issues.apache.org/jira/browse/OPENJPA-1965 Thanks, Rick On Thu, Mar 24, 2011 at 12:57 PM, Rick Curtis curti...@gmail.com wrote: I have heard it said that programmatic javac compiler for debugging means that you have a junit testcase which calls com.sun.tools.javac.Main. I heard it somehow involved a chicken and some sort of voodoo dance. :) On Thu, Mar 24, 2011 at 11:27 AM, Michael Dick michael.d.d...@gmail.comwrote: On Thu, Mar 24, 2011 at 10:40 AM, Marc Logemann l...@logemann.org wrote: you are late. Not really. The code was written two years ago, with a programmatic javac compiler for debugging ;) thats not what i meant. I meant in following our discussion on the list ;-) When i am old and skilled i will check again what you mean with programmatic javac compiler for debugging :-) until that time point, i continue doing this poor implement a copy/pasted processor and write some println statements in there (c) hrhr. I have heard it said that programmatic javac compiler for debugging means that you have a junit testcase which calls com.sun.tools.javac.Main. That way you can debug your junit (or your own main method) and step into the compilation process. -mike
Re: MetaModel creation with -Aopenjpa.generate=true
great News! --- regards Marc Logemann http://www.logemann.org http://www.logentis.de Am 25.03.2011 um 15:56 schrieb Rick Curtis: Marc - This problem is fixed[1] in the 2.1.x stream and trunk. [1] http://issues.apache.org/jira/browse/OPENJPA-1965 Thanks, Rick On Thu, Mar 24, 2011 at 12:57 PM, Rick Curtis curti...@gmail.com wrote: I have heard it said that programmatic javac compiler for debugging means that you have a junit testcase which calls com.sun.tools.javac.Main. I heard it somehow involved a chicken and some sort of voodoo dance. :) On Thu, Mar 24, 2011 at 11:27 AM, Michael Dick michael.d.d...@gmail.comwrote: On Thu, Mar 24, 2011 at 10:40 AM, Marc Logemann l...@logemann.org wrote: you are late. Not really. The code was written two years ago, with a programmatic javac compiler for debugging ;) thats not what i meant. I meant in following our discussion on the list ;-) When i am old and skilled i will check again what you mean with programmatic javac compiler for debugging :-) until that time point, i continue doing this poor implement a copy/pasted processor and write some println statements in there (c) hrhr. I have heard it said that programmatic javac compiler for debugging means that you have a junit testcase which calls com.sun.tools.javac.Main. That way you can debug your junit (or your own main method) and step into the compilation process. -mike
Re: MetaModel creation with -Aopenjpa.generate=true
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) target name=JAXBCompiling description=Compile main source tree java files taskdef name=xjc classname=com.sun.tools.xjc.XJC2Task classpathref=toolingclasspath/ xjc schema=my.xsd destdir=${src.dir} package=domain.myweirdpackage/ /target 3) put at least one Entity in domain package (parent of myweirdpackage) 4) run the MetaModel compiling step Does this help? --- regards Marc Logemann http://www.logemann.org http://www.logentis.de Am 23.03.2011 um 20:45 schrieb Rick Curtis: Marc - Give this[1] patch a shot. If you can help me come up with a test Entity model that exposes this problem I have a pretty good chance of being able to get it into 2.1.1. [1] http://people.apache.org/~curtisr7/patches/annotation_processor_patch.jar Thanks, Rick On Wed, Mar 23, 2011 at 11:29 AM, Marc Logemann l...@logemann.org wrote: +1 for the patch on AnnotationProcessor6 for the 2.1.x release line. Of course this would make my life easier. I could drop my own variant. I always like using framework classes instead of patched-own-versions. --- regards Marc Logemann http://www.logemann.org http://www.logentis.de Am 23.03.2011 um 17:20 schrieb Rick Curtis: BTW it was a bit of a mess to create my own version of this class because SourceAnnotationHandler.class has a lot of package private methods which are used by AnnotationProcessor6. So i also needed to clone that class too. g. :-) I could easily create a patch to put on top of the existing AnnotationProcessor6 if that would make your life easier? (You're running 2.1.x right?) I am quite sure that there are not that much people out there using the MetaModel feature at all. Because first you need to use Criteria API which is probably also not THAT widespreaded so far. This could be the reason why this bug is not mentioned somewhere. +1 Thanks, Rick On Wed, Mar 23, 2011 at 11:03 AM, Marc Logemann l...@logemann.org wrote: Hi, hope i could help a bit in researching this. For now i will use my own variant of AnnotationProcessor6. BTW it was a bit of a mess to create my own version of this class because SourceAnnotationHandler.class has a lot of package private methods which are used by AnnotationProcessor6. So i also needed to clone that class too. g. :-) I am quite sure that there are not that much people out there using the MetaModel feature at all. Because first you need to use Criteria API which is probably also not THAT widespreaded so far. This could be the reason why this bug is not mentioned somwhere. But software development is crazy. You start using Criteria API because its somewhat typesafe in conjunction with MetaModel and now you are fighting with AnnotationProcessor. Not really where we make our money. But on the other hand its a challenge to find out why things break. --- regards Marc Logemann http://www.logemann.org http://www.logentis.de Am 23.03.2011 um 16:55 schrieb Rick Curtis: Yes that seems reasonable. I'll get that taken care of sometime this afternoon. I'd like to get another JIRA opened up to investigate the JAXB packageElements problem Thanks, Rick On Wed, Mar 23, 2011 at 10:51 AM, Marc Logemann l...@logemann.org wrote: For the time being, how about the following fix in openjpa trunk: /** * The entry point for java compiler. */ @Override public boolean process(Set? extends TypeElement annos, RoundEnvironment roundEnv) { if (active !roundEnv.processingOver()) { Set? extends Element elements = roundEnv.getRootElements(); for (Element e : elements) { if (e instanceof TypeElement) process((TypeElement) e); } } return true; } We simply ignore PackageElement, ExecutableElement, TypeParameterElement and VariableElement. (These are the other Subinterfaces of Element) With this we dont get into trouble and we have time to elaborate on the real problem. roundEnv.getRootElements() simply can return also PackageElements. Why this is only the case for this package with JAXB file is something which one need to research. Thats definitely something in the javax.annotation.processing area of the JDK. But there must be a reason that getRootElements() returns Element and not TypeElement ;-) --- regards Marc Logemann http://www.logemann.org http://www.logentis.de Am 23.03.2011 um 16:41 schrieb Rick Curtis: still a bit clueless Me too. I just started digging into some of the annotation processor code to see if I can
Re: MetaModel creation with -Aopenjpa.generate=true
Debugging is also not that easy within an ANT process. Perhaps someone give me an hint how to proceed. Invoke javac compiler programmatically. Pass opejpa.metamodel in compiler argument. You will require tools.jar in your classpath. - Pinaki -- View this message in context: http://openjpa.208410.n2.nabble.com/MetaModel-creation-with-Aopenjpa-generate-true-tp6200077p6204075.html Sent from the OpenJPA Users mailing list archive at Nabble.com.
Re: MetaModel creation with -Aopenjpa.generate=true
Hi, i am quite sure that there were a lot more jars when i had the single ALL dependency in my ivy setup. Dont have the time to prove right now. In fact one dont need the service file when using the -processor flag in javac. --- regards Marc Logemann http://www.logemann.org http://www.logentis.de Am 24.03.2011 um 14:00 schrieb Pinaki Poddar: Hi, The annotation processing requires dependency on openjpa-all jar. Can you please explain why you declared dependencies to individual module jars but not the consolidated openjpa jar? I dont want to inlcude openjpa as a whole because i want to leave out unneeded clutter. But it seemed to be OK to include 3/4 individual openjpa*.jar -- that looks more cluttered to me. Anyway, our service file packaging will not cope with the individual jar dependencies as you have described. You need to have a single openjpa jar in your classpath To generate canonical metamodel classes using OpenJPA has two pre-requisites 1. compiler classpath must have consolidated openjpa jar 2. Compiler argument -Aopenjpa.metamodel=true must be set - Pinaki -- View this message in context: http://openjpa.208410.n2.nabble.com/MetaModel-creation-with-Aopenjpa-generate-true-tp6200077p6203998.html Sent from the OpenJPA Users mailing list archive at Nabble.com.
Re: MetaModel creation with -Aopenjpa.generate=true
you are late. We basically figured out all the issues. I also presented a fix and Rick supplied a patched jar and hopefully this fix will make it into the next 2.1 release. --- regards Marc Logemann http://www.logemann.org http://www.logentis.de Am 24.03.2011 um 14:25 schrieb Pinaki Poddar: Debugging is also not that easy within an ANT process. Perhaps someone give me an hint how to proceed. Invoke javac compiler programmatically. Pass opejpa.metamodel in compiler argument. You will require tools.jar in your classpath. - Pinaki -- View this message in context: http://openjpa.208410.n2.nabble.com/MetaModel-creation-with-Aopenjpa-generate-true-tp6200077p6204075.html Sent from the OpenJPA Users mailing list archive at Nabble.com.
Re: MetaModel creation with -Aopenjpa.generate=true
We basically figured out all the issues. I am sure you did. Good luck :) you are late. Not really. The code was written two years ago, with a programmatic javac compiler for debugging ;) - Pinaki -- View this message in context: http://openjpa.208410.n2.nabble.com/MetaModel-creation-with-Aopenjpa-generate-true-tp6200077p6204525.html Sent from the OpenJPA Users mailing list archive at Nabble.com.
Re: MetaModel creation with -Aopenjpa.generate=true
On Thu, Mar 24, 2011 at 10:40 AM, Marc Logemann l...@logemann.org wrote: you are late. Not really. The code was written two years ago, with a programmatic javac compiler for debugging ;) thats not what i meant. I meant in following our discussion on the list ;-) When i am old and skilled i will check again what you mean with programmatic javac compiler for debugging :-) until that time point, i continue doing this poor implement a copy/pasted processor and write some println statements in there (c) hrhr. I have heard it said that programmatic javac compiler for debugging means that you have a junit testcase which calls com.sun.tools.javac.Main. That way you can debug your junit (or your own main method) and step into the compilation process. -mike
Re: MetaModel creation with -Aopenjpa.generate=true
Am 24.03.2011 um 17:27 schrieb Michael Dick: On Thu, Mar 24, 2011 at 10:40 AM, Marc Logemann l...@logemann.org wrote: you are late. Not really. The code was written two years ago, with a programmatic javac compiler for debugging ;) thats not what i meant. I meant in following our discussion on the list ;-) When i am old and skilled i will check again what you mean with programmatic javac compiler for debugging :-) until that time point, i continue doing this poor implement a copy/pasted processor and write some println statements in there (c) hrhr. I have heard it said that programmatic javac compiler for debugging means that you have a junit testcase which calls com.sun.tools.javac.Main. That way you can debug your junit (or your own main method) and step into the compilation process. -mike ahh now i get it. This sounds smart. To be honest, i never ever dealt with com.sun.tools.javac.Main directly during my 8 years of java development ;-) My way was also quite nice because now i have my own AnnotationProcessor variant, which will stay active until you guys fix the one in the 2.1.x release... or i can use Ricks patched jar of course. Marc
Re: MetaModel creation with -Aopenjpa.generate=true
I have heard it said that programmatic javac compiler for debugging means that you have a junit testcase which calls com.sun.tools.javac.Main. I heard it somehow involved a chicken and some sort of voodoo dance. :) On Thu, Mar 24, 2011 at 11:27 AM, Michael Dick michael.d.d...@gmail.comwrote: On Thu, Mar 24, 2011 at 10:40 AM, Marc Logemann l...@logemann.org wrote: you are late. Not really. The code was written two years ago, with a programmatic javac compiler for debugging ;) thats not what i meant. I meant in following our discussion on the list ;-) When i am old and skilled i will check again what you mean with programmatic javac compiler for debugging :-) until that time point, i continue doing this poor implement a copy/pasted processor and write some println statements in there (c) hrhr. I have heard it said that programmatic javac compiler for debugging means that you have a junit testcase which calls com.sun.tools.javac.Main. That way you can debug your junit (or your own main method) and step into the compilation process. -mike
Re: MetaModel creation with -Aopenjpa.generate=true
Thats exactly what i am trying the last 10 minutes but its not that easy because he doesnt process alphabetically or something. In fact i have more than 30 entities which are not processed. One of those is the problem of course. the compilerarg value=-Aopenjpa.log=TRACE/ thingy doesnt reveal very much. I just see many lines like these: [javac] Note: Generating canonical metamodel source code src/de/netversys/domain/JobTrigger_.java [javac] Note: Generating canonical metamodel source code src/de/netversys/domain/Label_.java ... Dont even know if this is a trace output or just the usual clutter which comes out anyway. Debugging is also not that easy within an ANT process. Perhaps someone give me an hint how to proceed. I really dont want to recompile the AnnotationProcessor6 class. --- regards Marc Logemann http://www.logemann.org http://www.logentis.de Am 23.03.2011 um 15:51 schrieb Rick Curtis: Marc - Can you narrow down the Entity which is having the problem so we can write a unit test? Thanks, Rick
Re: MetaModel creation with -Aopenjpa.generate=true
one more thing. You have something like this in the second process() method: private boolean process(TypeElement e) { catch (Exception e1) { logger.error(_loc.get(mmg-process-error, e.getQualifiedName()), e1); return false; } finally { ... This is cool if get an error in the real process but this one here: public boolean process(Set? extends TypeElement annos, RoundEnvironment roundEnv) { if (active !roundEnv.processingOver()) { Set? extends Element elements = roundEnv.getRootElements(); for (Element e : elements) { process((TypeElement) e); } } } is the caller and we dont have any logging here if the cast fails. This leaves a user in a unpleasant situation when something goes wrong on that line (as it is with my situation). As every java developer know a cast can fail and i would like to see a logging for that to and a re-throw after that. --- regards Marc Logemann http://www.logemann.org http://www.logentis.de Am 23.03.2011 um 15:51 schrieb Rick Curtis: Marc - Can you narrow down the Entity which is having the problem so we can write a unit test? Thanks, Rick
Re: MetaModel creation with -Aopenjpa.generate=true
Correction: With my program, i get a result of course because i dont leave the process on error ;-) But this is the solution. This is NOT the solution i meant. --- regards Marc Logemann http://www.logemann.org http://www.logentis.de Am 23.03.2011 um 16:38 schrieb Marc Logemann: Puuuh. Its me again. I am gone the hard route and created my own variant of AnnotationProcesso: @Override public boolean process(Set? extends TypeElement annos, RoundEnvironment roundEnv) { if (active !roundEnv.processingOver()) { Set? extends Element elements = roundEnv.getRootElements(); for (Element e : elements) { try { System.out.println(Element inside Set -- + e); process((TypeElement) e); } catch (RuntimeException e1) { System.out.println(Error --+ e); } } } return true; } with more logging and something strange can be seen: ... [javac] Element inside Set -- de.netversys.carriers.tourline.process.TourlineRoutingBarcode [javac] Element inside Set -- de.netversys.carriers.tourline.process.TourlineSenderBarcode [javac] Element inside Set -- de.netversys.carriers.bartolini.domain.xml [javac] Error --de.netversys.carriers.bartolini.domain.xml The -- lines is the output before the process() call in the for loop which i coded in there. The last line is interessting. This is not a class, this is a package! (with JAXB generated stuff in it) Now the error message java.lang.ClassCastException: com.sun.tools.javac.code.Symbol$PackageSymbol cannot be cast to javax.lang.model.element.TypeElement makes sense because he says something about PackageSymbol. Now more questions comes up than it solves. Why is this package inside the Element Set ?? Its a normal package under one of my domain packages. But inside this package, there are only JAXB generated classes. Perhaps JAXB generated classe with its ObjectFactory stuff is handled differently by the JDK Annotation framework. But i have other places with JAXB stuff in it. Cant be the issue. With my program, i get a result of course because i dont leave the process on error ;-) But this is the solution. still a bit clueless -- regards Marc Logemann http://www.logemann.org http://www.logentis.de Am 23.03.2011 um 15:51 schrieb Rick Curtis: Marc - Can you narrow down the Entity which is having the problem so we can write a unit test? Thanks, Rick
Re: MetaModel creation with -Aopenjpa.generate=true
still a bit clueless Me too. I just started digging into some of the annotation processor code to see if I can learn something today So when you swallowed the exception everything worked fine? Thanks, Rick
Re: MetaModel creation with -Aopenjpa.generate=true
For the time being, how about the following fix in openjpa trunk: /** * The entry point for java compiler. */ @Override public boolean process(Set? extends TypeElement annos, RoundEnvironment roundEnv) { if (active !roundEnv.processingOver()) { Set? extends Element elements = roundEnv.getRootElements(); for (Element e : elements) { if (e instanceof TypeElement) process((TypeElement) e); } } return true; } We simply ignore PackageElement, ExecutableElement, TypeParameterElement and VariableElement. (These are the other Subinterfaces of Element) With this we dont get into trouble and we have time to elaborate on the real problem. roundEnv.getRootElements() simply can return also PackageElements. Why this is only the case for this package with JAXB file is something which one need to research. Thats definitely something in the javax.annotation.processing area of the JDK. But there must be a reason that getRootElements() returns Element and not TypeElement ;-) --- regards Marc Logemann http://www.logemann.org http://www.logentis.de Am 23.03.2011 um 16:41 schrieb Rick Curtis: still a bit clueless Me too. I just started digging into some of the annotation processor code to see if I can learn something today So when you swallowed the exception everything worked fine? Thanks, Rick
Re: MetaModel creation with -Aopenjpa.generate=true
Yes that seems reasonable. I'll get that taken care of sometime this afternoon. I'd like to get another JIRA opened up to investigate the JAXB packageElements problem Thanks, Rick On Wed, Mar 23, 2011 at 10:51 AM, Marc Logemann l...@logemann.org wrote: For the time being, how about the following fix in openjpa trunk: /** * The entry point for java compiler. */ @Override public boolean process(Set? extends TypeElement annos, RoundEnvironment roundEnv) { if (active !roundEnv.processingOver()) { Set? extends Element elements = roundEnv.getRootElements(); for (Element e : elements) { if (e instanceof TypeElement) process((TypeElement) e); } } return true; } We simply ignore PackageElement, ExecutableElement, TypeParameterElement and VariableElement. (These are the other Subinterfaces of Element) With this we dont get into trouble and we have time to elaborate on the real problem. roundEnv.getRootElements() simply can return also PackageElements. Why this is only the case for this package with JAXB file is something which one need to research. Thats definitely something in the javax.annotation.processing area of the JDK. But there must be a reason that getRootElements() returns Element and not TypeElement ;-) --- regards Marc Logemann http://www.logemann.org http://www.logentis.de Am 23.03.2011 um 16:41 schrieb Rick Curtis: still a bit clueless Me too. I just started digging into some of the annotation processor code to see if I can learn something today So when you swallowed the exception everything worked fine? Thanks, Rick
Re: MetaModel creation with -Aopenjpa.generate=true
Hi, hope i could help a bit in researching this. For now i will use my own variant of AnnotationProcessor6. BTW it was a bit of a mess to create my own version of this class because SourceAnnotationHandler.class has a lot of package private methods which are used by AnnotationProcessor6. So i also needed to clone that class too. g. :-) I am quite sure that there are not that much people out there using the MetaModel feature at all. Because first you need to use Criteria API which is probably also not THAT widespreaded so far. This could be the reason why this bug is not mentioned somwhere. But software development is crazy. You start using Criteria API because its somewhat typesafe in conjunction with MetaModel and now you are fighting with AnnotationProcessor. Not really where we make our money. But on the other hand its a challenge to find out why things break. --- regards Marc Logemann http://www.logemann.org http://www.logentis.de Am 23.03.2011 um 16:55 schrieb Rick Curtis: Yes that seems reasonable. I'll get that taken care of sometime this afternoon. I'd like to get another JIRA opened up to investigate the JAXB packageElements problem Thanks, Rick On Wed, Mar 23, 2011 at 10:51 AM, Marc Logemann l...@logemann.org wrote: For the time being, how about the following fix in openjpa trunk: /** * The entry point for java compiler. */ @Override public boolean process(Set? extends TypeElement annos, RoundEnvironment roundEnv) { if (active !roundEnv.processingOver()) { Set? extends Element elements = roundEnv.getRootElements(); for (Element e : elements) { if (e instanceof TypeElement) process((TypeElement) e); } } return true; } We simply ignore PackageElement, ExecutableElement, TypeParameterElement and VariableElement. (These are the other Subinterfaces of Element) With this we dont get into trouble and we have time to elaborate on the real problem. roundEnv.getRootElements() simply can return also PackageElements. Why this is only the case for this package with JAXB file is something which one need to research. Thats definitely something in the javax.annotation.processing area of the JDK. But there must be a reason that getRootElements() returns Element and not TypeElement ;-) --- regards Marc Logemann http://www.logemann.org http://www.logentis.de Am 23.03.2011 um 16:41 schrieb Rick Curtis: still a bit clueless Me too. I just started digging into some of the annotation processor code to see if I can learn something today So when you swallowed the exception everything worked fine? Thanks, Rick
Re: MetaModel creation with -Aopenjpa.generate=true
BTW it was a bit of a mess to create my own version of this class because SourceAnnotationHandler.class has a lot of package private methods which are used by AnnotationProcessor6. So i also needed to clone that class too. g. :-) I could easily create a patch to put on top of the existing AnnotationProcessor6 if that would make your life easier? (You're running 2.1.x right?) I am quite sure that there are not that much people out there using the MetaModel feature at all. Because first you need to use Criteria API which is probably also not THAT widespreaded so far. This could be the reason why this bug is not mentioned somewhere. +1 Thanks, Rick On Wed, Mar 23, 2011 at 11:03 AM, Marc Logemann l...@logemann.org wrote: Hi, hope i could help a bit in researching this. For now i will use my own variant of AnnotationProcessor6. BTW it was a bit of a mess to create my own version of this class because SourceAnnotationHandler.class has a lot of package private methods which are used by AnnotationProcessor6. So i also needed to clone that class too. g. :-) I am quite sure that there are not that much people out there using the MetaModel feature at all. Because first you need to use Criteria API which is probably also not THAT widespreaded so far. This could be the reason why this bug is not mentioned somwhere. But software development is crazy. You start using Criteria API because its somewhat typesafe in conjunction with MetaModel and now you are fighting with AnnotationProcessor. Not really where we make our money. But on the other hand its a challenge to find out why things break. --- regards Marc Logemann http://www.logemann.org http://www.logentis.de Am 23.03.2011 um 16:55 schrieb Rick Curtis: Yes that seems reasonable. I'll get that taken care of sometime this afternoon. I'd like to get another JIRA opened up to investigate the JAXB packageElements problem Thanks, Rick On Wed, Mar 23, 2011 at 10:51 AM, Marc Logemann l...@logemann.org wrote: For the time being, how about the following fix in openjpa trunk: /** * The entry point for java compiler. */ @Override public boolean process(Set? extends TypeElement annos, RoundEnvironment roundEnv) { if (active !roundEnv.processingOver()) { Set? extends Element elements = roundEnv.getRootElements(); for (Element e : elements) { if (e instanceof TypeElement) process((TypeElement) e); } } return true; } We simply ignore PackageElement, ExecutableElement, TypeParameterElement and VariableElement. (These are the other Subinterfaces of Element) With this we dont get into trouble and we have time to elaborate on the real problem. roundEnv.getRootElements() simply can return also PackageElements. Why this is only the case for this package with JAXB file is something which one need to research. Thats definitely something in the javax.annotation.processing area of the JDK. But there must be a reason that getRootElements() returns Element and not TypeElement ;-) --- regards Marc Logemann http://www.logemann.org http://www.logentis.de Am 23.03.2011 um 16:41 schrieb Rick Curtis: still a bit clueless Me too. I just started digging into some of the annotation processor code to see if I can learn something today So when you swallowed the exception everything worked fine? Thanks, Rick
Re: MetaModel creation with -Aopenjpa.generate=true
+1 for the patch on AnnotationProcessor6 for the 2.1.x release line. Of course this would make my life easier. I could drop my own variant. I always like using framework classes instead of patched-own-versions. --- regards Marc Logemann http://www.logemann.org http://www.logentis.de Am 23.03.2011 um 17:20 schrieb Rick Curtis: BTW it was a bit of a mess to create my own version of this class because SourceAnnotationHandler.class has a lot of package private methods which are used by AnnotationProcessor6. So i also needed to clone that class too. g. :-) I could easily create a patch to put on top of the existing AnnotationProcessor6 if that would make your life easier? (You're running 2.1.x right?) I am quite sure that there are not that much people out there using the MetaModel feature at all. Because first you need to use Criteria API which is probably also not THAT widespreaded so far. This could be the reason why this bug is not mentioned somewhere. +1 Thanks, Rick On Wed, Mar 23, 2011 at 11:03 AM, Marc Logemann l...@logemann.org wrote: Hi, hope i could help a bit in researching this. For now i will use my own variant of AnnotationProcessor6. BTW it was a bit of a mess to create my own version of this class because SourceAnnotationHandler.class has a lot of package private methods which are used by AnnotationProcessor6. So i also needed to clone that class too. g. :-) I am quite sure that there are not that much people out there using the MetaModel feature at all. Because first you need to use Criteria API which is probably also not THAT widespreaded so far. This could be the reason why this bug is not mentioned somwhere. But software development is crazy. You start using Criteria API because its somewhat typesafe in conjunction with MetaModel and now you are fighting with AnnotationProcessor. Not really where we make our money. But on the other hand its a challenge to find out why things break. --- regards Marc Logemann http://www.logemann.org http://www.logentis.de Am 23.03.2011 um 16:55 schrieb Rick Curtis: Yes that seems reasonable. I'll get that taken care of sometime this afternoon. I'd like to get another JIRA opened up to investigate the JAXB packageElements problem Thanks, Rick On Wed, Mar 23, 2011 at 10:51 AM, Marc Logemann l...@logemann.org wrote: For the time being, how about the following fix in openjpa trunk: /** * The entry point for java compiler. */ @Override public boolean process(Set? extends TypeElement annos, RoundEnvironment roundEnv) { if (active !roundEnv.processingOver()) { Set? extends Element elements = roundEnv.getRootElements(); for (Element e : elements) { if (e instanceof TypeElement) process((TypeElement) e); } } return true; } We simply ignore PackageElement, ExecutableElement, TypeParameterElement and VariableElement. (These are the other Subinterfaces of Element) With this we dont get into trouble and we have time to elaborate on the real problem. roundEnv.getRootElements() simply can return also PackageElements. Why this is only the case for this package with JAXB file is something which one need to research. Thats definitely something in the javax.annotation.processing area of the JDK. But there must be a reason that getRootElements() returns Element and not TypeElement ;-) --- regards Marc Logemann http://www.logemann.org http://www.logentis.de Am 23.03.2011 um 16:41 schrieb Rick Curtis: still a bit clueless Me too. I just started digging into some of the annotation processor code to see if I can learn something today So when you swallowed the exception everything worked fine? Thanks, Rick
Re: MetaModel creation with -Aopenjpa.generate=true
Marc - Give this[1] patch a shot. If you can help me come up with a test Entity model that exposes this problem I have a pretty good chance of being able to get it into 2.1.1. [1] http://people.apache.org/~curtisr7/patches/annotation_processor_patch.jar Thanks, Rick On Wed, Mar 23, 2011 at 11:29 AM, Marc Logemann l...@logemann.org wrote: +1 for the patch on AnnotationProcessor6 for the 2.1.x release line. Of course this would make my life easier. I could drop my own variant. I always like using framework classes instead of patched-own-versions. --- regards Marc Logemann http://www.logemann.org http://www.logentis.de Am 23.03.2011 um 17:20 schrieb Rick Curtis: BTW it was a bit of a mess to create my own version of this class because SourceAnnotationHandler.class has a lot of package private methods which are used by AnnotationProcessor6. So i also needed to clone that class too. g. :-) I could easily create a patch to put on top of the existing AnnotationProcessor6 if that would make your life easier? (You're running 2.1.x right?) I am quite sure that there are not that much people out there using the MetaModel feature at all. Because first you need to use Criteria API which is probably also not THAT widespreaded so far. This could be the reason why this bug is not mentioned somewhere. +1 Thanks, Rick On Wed, Mar 23, 2011 at 11:03 AM, Marc Logemann l...@logemann.org wrote: Hi, hope i could help a bit in researching this. For now i will use my own variant of AnnotationProcessor6. BTW it was a bit of a mess to create my own version of this class because SourceAnnotationHandler.class has a lot of package private methods which are used by AnnotationProcessor6. So i also needed to clone that class too. g. :-) I am quite sure that there are not that much people out there using the MetaModel feature at all. Because first you need to use Criteria API which is probably also not THAT widespreaded so far. This could be the reason why this bug is not mentioned somwhere. But software development is crazy. You start using Criteria API because its somewhat typesafe in conjunction with MetaModel and now you are fighting with AnnotationProcessor. Not really where we make our money. But on the other hand its a challenge to find out why things break. --- regards Marc Logemann http://www.logemann.org http://www.logentis.de Am 23.03.2011 um 16:55 schrieb Rick Curtis: Yes that seems reasonable. I'll get that taken care of sometime this afternoon. I'd like to get another JIRA opened up to investigate the JAXB packageElements problem Thanks, Rick On Wed, Mar 23, 2011 at 10:51 AM, Marc Logemann l...@logemann.org wrote: For the time being, how about the following fix in openjpa trunk: /** * The entry point for java compiler. */ @Override public boolean process(Set? extends TypeElement annos, RoundEnvironment roundEnv) { if (active !roundEnv.processingOver()) { Set? extends Element elements = roundEnv.getRootElements(); for (Element e : elements) { if (e instanceof TypeElement) process((TypeElement) e); } } return true; } We simply ignore PackageElement, ExecutableElement, TypeParameterElement and VariableElement. (These are the other Subinterfaces of Element) With this we dont get into trouble and we have time to elaborate on the real problem. roundEnv.getRootElements() simply can return also PackageElements. Why this is only the case for this package with JAXB file is something which one need to research. Thats definitely something in the javax.annotation.processing area of the JDK. But there must be a reason that getRootElements() returns Element and not TypeElement ;-) --- regards Marc Logemann http://www.logemann.org http://www.logentis.de Am 23.03.2011 um 16:41 schrieb Rick Curtis: still a bit clueless Me too. I just started digging into some of the annotation processor code to see if I can learn something today So when you swallowed the exception everything worked fine? Thanks, Rick