Hi.
thx for pointing out the -processor thingy. This works basically and i dont
have to worry what kind of jar to include or to check where the service file is
(the openjpa team should really think about putting it to
openjpa-persistence.jar again).
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)
So now my build fails and this before my very own classes get compiled. I get a
lot of metamodel classes and within that process that ClassCastException occurs.
---
regards
Marc Logemann
http://www.logemann.org
http://www.logentis.de
Am 23.03.2011 um 15:03 schrieb Rick Curtis:
>> If you try manually adding the services entry, do the metamodel classes get
> generated correctly?
>
> Perhaps you could try? <compilerarg value="-processor
> org.apache.openjpa.persistence.meta.AnnotationProcessor6"/>
>
> Thanks,
> Rick
>
> On Wed, Mar 23, 2011 at 8:59 AM, Michael Dick <[email protected]>wrote:
>
>> Hi,
>>
>> The services file was intentionally moved under
>> OPENJPA-1622<https://issues.apache.org/jira/browse/OPENJPA-1622>.
>> It's not clear from the JIRA why it was moved, but my guess is that it was
>> causing problems with the aggregate jars or OSGi.
>>
>> I'm not sure that's a lot of help. If you try manually adding the services
>> entry, do the metamodel classes get generated correctly?
>>
>> -mike
>>
>> On Wed, Mar 23, 2011 at 8:54 AM, Marc Logemann <[email protected]> wrote:
>>
>>> Thats what i gussed at the same time (and sent to the list) as you can
>> see
>>> ;-)
>>> I will check my deps. I dont want to inlcude "openjpa" as a whole because
>> i
>>> want to leave out unneeded clutter.
>>>
>>> But one thing is weird. The class "AnnotationProcessor6" which is the
>> main
>>> actor in this game is in openjpa-persistence-2.1.0.jar, wouldnt you
>> expect
>>> the service definition in the very same jar file? I do....
>>>
>>> --
>>> regards
>>> Marc Logemann
>>> http://www.logemann.org
>>> http://www.logentis.de
>>>
>>>
>>>
>>>
>>> Am 23.03.2011 um 14:46 schrieb Rick Curtis:
>>>
>>>> Try adding a dependency on "openjpa". I'm guessing that the services
>>> file[1]
>>>> isn't packaged in any of your dependencies.?
>>>>
>>>> [1] META-INF/services/javax.annotation.processing.Processor
>>>>
>>>> Thanks,
>>>> Rick
>>>>
>>>> On Wed, Mar 23, 2011 at 7:26 AM, Marc Logemann <[email protected]>
>> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> i want to create metamodel classes during build time. So i did that:
>>>>>
>>>>> <javac destdir="${build.dir}" fork="true" debug="true"
>>>>> optimize="false"
>>>>> deprecation="false" failonerror="true" target="1.6"
>>>>> memoryinitialsize="512m" memorymaximumsize="512m">
>>>>> <src path="${src.dir}"/>
>>>>> <classpath refid="classpath"/>
>>>>> <compilerarg value="-Aopenjpa.metamodel=true"/>
>>>>> </javac>
>>>>>
>>>>> see the compilerarg feature. The other stuff was already in my
>> build....
>>>>>
>>>>> But i dont see any results. I see no classes being generated
>> somewhere.
>>> I
>>>>> also dont see any warnings or stuff in the build itself. I am using
>>> these
>>>>> dependencies related to OpenJPA
>>>>>
>>>>> <dependency org="org.apache.openjpa" name="openjpa-jdbc"
>>> rev="2.1.0"
>>>>> conf="default->default,sources,javadoc"/>
>>>>> <dependency org="org.apache.openjpa" name="openjpa-kernel"
>>>>> rev="2.1.0" conf="default->default,sources,javadoc"/>
>>>>> <dependency org="org.apache.openjpa" name="openjpa-lib"
>>> rev="2.1.0"
>>>>> conf="default->default,sources,javadoc"/>
>>>>> <dependency org="org.apache.openjpa" name="openjpa-persistence"
>>>>> rev="2.1.0"
>>>>> conf="default->default,sources,javadoc"/>
>>>>> <dependency org="org.apache.openjpa"
>>> name="openjpa-persistence-jdbc"
>>>>> rev="2.1.0"
>>>>> conf="default->default,sources,javadoc"/>
>>>>> <dependency org="org.apache.geronimo.specs"
>>>>> name="geronimo-jpa_2.0_spec" rev="1.1"/>
>>>>>
>>>>>
>>>>> Can anybody tell me whats wrong?
>>>>>
>>>>>
>>>>> ---
>>>>> regards
>>>>> Marc Logemann
>>>>> http://www.logemann.org
>>>>> http://www.logentis.de
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>
>>>
>>