Hi
   
  I've got other problem now. I am
getting NullPointerException from CanonicalModelProcessor (see below).
Is there a way to debug the annotation processor to see what might
causing it?
   
  java.lang.RuntimeException:
java.lang.NullPointerException
 at
org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor.process(CanonicalModelProcessor.java:366)
 at
org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.handleProcessor(RoundDispatcher.java:139)
 at
org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.round(RoundDispatcher.java:121)
 at
org.eclipse.jdt.internal.compiler.apt.dispatch.BaseAnnotationProcessorManager.processAnnotations(BaseAnnotationProcessorManager.java:159)
 at
org.eclipse.jdt.internal.apt.pluggable.core.dispatch.IdeAnnotationProcessorManager.processAnnotations(IdeAnnotationProcessorManager.java:134)
 at
org.eclipse.jdt.internal.compiler.Compiler.processAnnotations(Compiler.java:809)
 at
org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:428)
 at
org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:364)
 at
org.eclipse.jdt.internal.core.builder.BatchImageBuilder.compile(BatchImageBuilder.java:178)
 at
org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:301)
 at
org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:60)
 at
org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:254)
 at
org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:173)
 at
org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:627)
 at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
 at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
 at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
 at
org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
 at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
 at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
 at
org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309)
 at
org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341)
 at
org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)
 at
org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)
 at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.lang.NullPointerException
 at
org.eclipse.persistence.internal.jpa.metadata.ORMetadata.mergeORObjectLists(ORMetadata.java:328)
 at
org.eclipse.persistence.internal.jpa.metadata.accessors.classes.XMLAttributes.merge(XMLAttributes.java:252)
 at
org.eclipse.persistence.internal.jpa.metadata.accessors.classes.ClassAccessor.merge(ClassAccessor.java:796)
 at
org.eclipse.persistence.internal.jpa.metadata.accessors.classes.MappedSuperclassAccessor.merge(MappedSuperclassAccessor.java:394)
 at
org.eclipse.persistence.internal.jpa.metadata.xml.XMLEntityMappings.initPersistenceUnitClasses(XMLEntityMappings.java:522)
 at
org.eclipse.persistence.internal.jpa.modelgen.objects.PersistenceUnit.initXMLEntityMappings(PersistenceUnit.java:392)
 at
org.eclipse.persistence.internal.jpa.modelgen.objects.PersistenceUnit.<init>(PersistenceUnit.java:85)
 at
org.eclipse.persistence.internal.jpa.modelgen.objects.PersistenceUnitReader.initPersistenceUnits(PersistenceUnitReader.java:168)
 at
org.eclipse.persistence.internal.jpa.modelgen.objects.PersistenceUnitReader.<init>(PersistenceUnitReader.java:63)
 at
org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor.process(CanonicalModelProcessor.java:329)
 ... 24 more
  
  Regards
   
  Jaro
  
  
  Guy
   
  Thanks for your answer. This is
little but unfortunate, as it prevents us from having a proper modular
desing where POJO domain objects and DAO interfaces are be defined in
one OSGi bundle, and another OSGi bundle with DAO implementations and
mapping files using specific ORM framework (EclipseLink in our case).
   
  However, I have found a
workaround which is based on having linked folder in Eclipse
linking source folder from Project A to Project B, so when Project B is
built, classes from Project A are built too and metamodel is generated
for them. Classes from a linked folder are built into separate output
dir, so they are not mixed with classes defined in source folder of
Project B.
   
  I can post a complete Eclipse
project config if anyone is interested.
   
  Regards
   
  Jaro
  
  
I can't think of a good way to do this off hand. The model gen hooks
into the compiler using APT. Therefore, EntityA would never be a round
element when compiling ProjectB.
  
You may want to open a bug to have it investigated further.
  
In the mean time, you'd have to turn on the model gen for Project A
with the same persistence.xml.
  
Cheers,
Guy
  
On 15/04/2010 12:41 PM, Kuruc, Jaro wrote:
  
    
    Hi
     
    I
am testing out the JPA2 Metamodel generation in Eclipse and it looks
like that EclipseLink's Modelgen Processor is only supporting metamodel
generation for entities defined in the same Eclipse project in which
persistence.xml is defined.
     
    Here's
my setup
     
    Project A:
    -
defines entity class EntityA
     
    Project
B:
    -
depends on Project A, hence having EntityA on classpath
    -
defines entity class EntityB
    -
defines persistence.xml
    -
annotation processor is switched on
     
    The
result is that EntityB_ is generated, but not EntityA_. I have tried
both annotation based mappings and mappings in orm.xml, but the result
is the same. Is there a way to tell EclipseLink Annotation
Processor to generate metadata for all classes on classpath? Maybe even
restricting it by specifying package to scan? Thanks.
     
    Regards
    
    
    Jaro Kuruc
    Java/SQL
Developer
    
    Commerzbank AG
    Corporates & Markets
    Market
Risk
    Office address: 30 Gresham Street, London EC2V 7PG, United
Kingdom
    
    Phone +44 (0)20 7475 8258
    
    jaro.kuruc@xxxxxxxxxxxxxxx
    
    http://www.commerzbank.com
    
    Commerzbank Aktiengesellschaft,
Frankfurt am Main
    Handelsregister/Commercial Register: Amtsgericht Frankfurt am
    Main, HRB 32000
    Vorsitzender des Aufsichtsrates/Chairman
of the Supervisory Board: Klaus-Peter Müller
    Vorstand/Board of Managing
Directors: Martin Blessing (Vorsitzender/Chairman),
Frank Annuscheit, Markus Beumer, Achim Kassow, Jochen Klösges, Michael Reuther, Stefan Schmittmann, Ulrich Sieber,
Eric Strutz
     
     
     
    This e-mail is confidential and is intended only for the person to whom it is 
addressed.  It may be privileged and should not be read, copied or used by
anyone other than the intended recipient.  If you are not that person, you are
not permitted to make use of the information and you are requested to notify
the sender immediately that you have received it and then destroy the copy in
your possession without disclosing its contents to any person.
Commerzbank AG may monitor outgoing and incoming e-mails.  By replying to this
e-mail you consent to such monitoring.  We believe, but do not warrant, that 
this e-mail and any attachments are virus free, but you must take full 
responsibility for virus checking.
This e-mail was sent either by Commerzbank AG, London Branch, or by Commerzbank
Corporates & Markets, a division of Commerzbank AG.  Commerzbank AG is a 
company incorporated in the Federal Republic of Germany and registered in 
England (registered number FC008139, place of business 30 Gresham Street, 
London EC2V 7PG) and is authorised by Bundesanstalt fuer 
Finanzdienstleistungsaufsicht (BaFin) and authorised and subject to limited 
regulation by the Financial Services Authority (FSA).
  
    
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users
  
  
  This e-mail is confidential and is intended only for the person to whom it is 
addressed.  It may be privileged and should not be read, copied or used by
anyone other than the intended recipient.  If you are not that person, you are
not permitted to make use of the information and you are requested to notify
the sender immediately that you have received it and then destroy the copy in
your possession without disclosing its contents to any person.
Commerzbank AG may monitor outgoing and incoming e-mails.  By replying to this
e-mail you consent to such monitoring.  We believe, but do not warrant, that 
this e-mail and any attachments are virus free, but you must take full 
responsibility for virus checking.
This e-mail was sent either by Commerzbank AG, London Branch, or by Commerzbank
Corporates & Markets, a division of Commerzbank AG.  Commerzbank AG is a 
company incorporated in the Federal Republic of Germany and registered in 
England (registered number FC008139, place of business 30 Gresham Street, 
London EC2V 7PG) and is authorised by Bundesanstalt fuer 
Finanzdienstleistungsaufsicht (BaFin) and authorised and subject to limited 
regulation by the Financial Services Authority (FSA).
  
  
This e-mail is confidential and is intended only for the person to whom it is 
addressed.  It may be privileged and should not be read, copied or used by
anyone other than the intended recipient.  If you are not that person, you are
not permitted to make use of the information and you are requested to notify
the sender immediately that you have received it and then destroy the copy in
your possession without disclosing its contents to any person.
Commerzbank AG may monitor outgoing and incoming e-mails.  By replying to this
e-mail you consent to such monitoring.  We believe, but do not warrant, that 
this e-mail and any attachments are virus free, but you must take full 
responsibility for virus checking.
This e-mail was sent either by Commerzbank AG, London Branch, or by Commerzbank
Corporates & Markets, a division of Commerzbank AG.  Commerzbank AG is a 
company incorporated in the Federal Republic of Germany and registered in 
England (registered number FC008139, place of business 30 Gresham Street, 
London EC2V 7PG) and is authorised by Bundesanstalt fuer 
Finanzdienstleistungsaufsicht (BaFin) and authorised and subject to limited 
regulation by the Financial Services Authority (FSA).
  
  
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users