Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Re: Problem generating metamodel (Guy Pelletier)

Hi Guy,
I am glad you got to bottom of the issue. I will try the workaround.

Thanks,
gopal



Message: 2
Date: Tue, 20 Apr 2010 14:58:26 -0400
From: Guy Pelletier <guy.pelletier@xxxxxxxxxx>
Subject: Re: [eclipselink-users] Re: Problem generating metamodel (Guy
    Pelletier)
To: guy.pelletier@xxxxxxxxxx,    EclipseLink User Discussions
    <eclipselink-users@xxxxxxxxxxx>
Message-ID: <4BCDF952.3050802@xxxxxxxxxx>
Content-Type: text/plain; charset="iso-8859-1"

I should also point out that you should 'disable the annotation
processing' and restart eclipse to clear the 'cache' and start fresh.

Cheers,
Guy

On 20/04/2010 1:56 PM, Guy Pelletier wrote:
> Gopal,
>
> Your issue seems to be the same as another user (Jaro) reported. I've
> reproduced the error and it is caused by mapped superclasses from xml
> not being initialized correctly. I asked Jaro to enter a bug. Please
> vote for the bug.
>
> In the mean time you can get around the issue by specifying you mapped
> superclasses using annotations rather than XML.
>
> Cheers,
> Guy
>
> On 19/04/2010 10:00 PM, Gopal Janjanam wrote:
>> Thanks Guy,
>> When I said I have explicitly defined access to "field", I have
>> <access>Field</access> element defined in orm.xml under top node.
>> Adding the access="Field" on every entity made me get pass that error.
>> But now getting following big trace. Any clue why getting this NPE
>> exception.
>>
>>
>>    [javac] error: java.lang.NullPointerException
>>    [javac] Note:
>> org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataAnnotatedElement.getDeclaredAnnotationsCount(MetadataAnnotatedElement.java:205)
>>    [javac] Note:
>> org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataAnnotatedElement.hasDeclaredAnnotations(MetadataAnnotatedElement.java:347)
>>    [javac] Note:
>> org.eclipse.persistence.internal.jpa.metadata.accessors.classes.ClassAccessor.havePersistenceFieldAnnotationsDefined(ClassAccessor.java:673)
>>    [javac] Note:
>> org.eclipse.persistence.internal.jpa.metadata.accessors.classes.MappedSuperclassAccessor.processAccessType(MappedSuperclassAccessor.java:483)
>>    [javac] Note:
>> org.eclipse.persistence.internal.jpa.metadata.accessors.classes.MappedSuperclassAccessor.preProcessForCanonicalModel(MappedSuperclassAccessor.java:452)
>>    [javac] Note:
>> org.eclipse.persistence.internal.jpa.modelgen.objects.PersistenceUnit.preProcessForCanonicalModel(PersistenceUnit.java:451)
>>    [javac] Note:
>> org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor.process(CanonicalModelProcessor.java:352)
>>    [javac] Note:
>> com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:624)
>>    [javac] Note:
>> com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:553)
>>    [javac] Note:
>> com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:698)
>>    [javac] Note:
>> com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:981)
>>    [javac] Note:
>> com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:727)
>>    [javac] Note: com.sun.tools.javac.main.Main.compile(Main.java:353)
>>    [javac] Note: com.sun.tools.javac.main.Main.compile(Main.java:279)
>>    [javac] Note: com.sun.tools.javac.main.Main.compile(Main.java:270)
>>    [javac] Note: com.sun.tools.javac.Main.compile(Main.java:69)
>>    [javac] Note: sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>> Method)
>>    [javac] Note:
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>    [javac] Note:
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>    [javac] Note: java.lang.reflect.Method.invoke(Method.java:597)
>>    [javac] Note:
>> org.apache.tools.ant.taskdefs.compilers.Javac13.execute(Javac13.java:56)
>>    [javac] Note:
>> org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1065)
>>    [javac] Note:
>> org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:882)
>>    [javac] Note:
>> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
>>    [javac] Note: sun.reflect.GeneratedMethodAccessor1.invoke(Unknown
>> Source)
>>    [javac] Note:
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>    [javac] Note: java.lang.reflect.Method.invoke(Method.java:597)
>>    [javac] Note:
>> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
>>    [javac] Note: org.apache.tools.ant.Task.perform(Task.java:348)
>>    [javac] Note: org.apache.tools.ant.Target.execute(Target.java:357)
>>    [javac] Note:
>> org.apache.tools.ant.Target.performTasks(Target.java:385)
>>    [javac] Note:
>> org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
>>    [javac] Note:
>> org.apache.tools.ant.Project.executeTarget(Project.java:1306)
>>    [javac] Note:
>> org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
>>    [javac] Note:
>> org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
>>    [javac] Note:
>> org.apache.tools.ant.Project.executeTargets(Project.java:1189)
>>    [javac] Note:
>> org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
>>    [javac] Note:
>> org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
>>    [javac] An annotation processor threw an uncaught exception.
>>    [javac] Consult the following stack trace for details.
>>    [javac] java.lang.RuntimeException: java.lang.NullPointerException
>>    [javac]    at
>> org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor.process(CanonicalModelProcessor.java:365)
>>    [javac]    at
>> com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:624)
>>    [javac]    at
>> com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:553)
>>    [javac]    at
>> com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:698)
>>    [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
>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>    [javac]    at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>    [javac]    at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>    [javac]    at java.lang.reflect.Method.invoke(Method.java:597)
>>    [javac]    at
>> org.apache.tools.ant.taskdefs.compilers.Javac13.execute(Javac13.java:56)
>>    [javac]    at
>> org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1065)
>>    [javac]    at
>> org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:882)
>>    [javac]    at
>> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
>>    [javac]    at
>> sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
>>    [javac]    at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>    [javac]    at java.lang.reflect.Method.invoke(Method.java:597)
>>    [javac]    at
>> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
>>    [javac]    at org.apache.tools.ant.Task.perform(Task.java:348)
>>    [javac]    at org.apache.tools.ant.Target.execute(Target.java:357)
>>    [javac]    at
>> org.apache.tools.ant.Target.performTasks(Target.java:385)
>>    [javac]    at
>> org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
>>    [javac]    at
>> org.apache.tools.ant.Project.executeTarget(Project.java:1306)
>>    [javac]    at
>> org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
>>    [javac]    at
>> org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
>>    [javac]    at
>> org.apache.tools.ant.Project.executeTargets(Project.java:1189)
>>    [javac]    at
>> org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
>>    [javac]    at
>> org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
>>    [javac] Caused by: java.lang.NullPointerException
>>    [javac]    at
>> org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataAnnotatedElement.getDeclaredAnnotationsCount(MetadataAnnotatedElement.java:205)
>>    [javac]    at
>> org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataAnnotatedElement.hasDeclaredAnnotations(MetadataAnnotatedElement.java:347)
>>    [javac]    at
>> org.eclipse.persistence.internal.jpa.metadata.accessors.classes.ClassAccessor.havePersistenceFieldAnnotationsDefined(ClassAccessor.java:673)
>>    [javac]    at
>> org.eclipse.persistence.internal.jpa.metadata.accessors.classes.MappedSuperclassAccessor.processAccessType(MappedSuperclassAccessor.java:483)
>>    [javac]    at
>> org.eclipse.persistence.internal.jpa.metadata.accessors.classes.MappedSuperclassAccessor.preProcessForCanonicalModel(MappedSuperclassAccessor.java:452)
>>    [javac]    at
>> org.eclipse.persistence.internal.jpa.modelgen.objects.PersistenceUnit.preProcessForCanonicalModel(PersistenceUnit.java:451)
>>    [javac]    at
>> org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor.process(CanonicalModelProcessor.java:352)
>>    [javac]    ... 31 more
>>
>>
>> -------------------------------------
>>
>> Date: Mon, 19 Apr 2010 13:14:40 -0400
>> From: Guy Pelletier <guy.pelletier@xxxxxxxxxx
>> <mailto:guy.pelletier@xxxxxxxxxx>>
>> Subject: Re: [eclipselink-users] Problem generating metamodel
>> To: EclipseLink User Discussions <eclipselink-users@xxxxxxxxxxx
>> <mailto:eclipselink-users@xxxxxxxxxxx>>
>> Message-ID: <4BCC8F80.4060507@xxxxxxxxxx
>> <mailto:4BCC8F80.4060507@xxxxxxxxxx>>
>> Content-Type: text/plain; charset="iso-8859-1"
>>
>> Interesting, if you add access=FIELD to the entity specification,
>> that is,
>>
>> <entity class="UserGroupList" name="UserGroupList" access=FIELD>
>>
>> You still get the exception? I'm wondering if the @Override annotations
>> are causing an invalid property access and invalid persistence mapping
>> detection. Could be a bug here.
>>
>> Cheers,
>> Guy
>>
>> **
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> eclipselink-users mailing list
>> eclipselink-users@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>> 
> ------------------------------------------------------------------------
>
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://dev.eclipse.org/mailman/private/eclipselink-users/attachments/20100420/43f0e80e/attachment.html

------------------------------

_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


End of eclipselink-users Digest, Vol 32, Issue 32
*************************************************


Back to the top