Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 331937 - Entity generating tool cannot identify project references with enums
Summary: Entity generating tool cannot identify project references with enums
Status: CLOSED NOT_ECLIPSE
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: General (show other bugs)
Version: 2.3.2   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: dali.general-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-06 13:43 EST by Allan Zhang CLA
Modified: 2010-12-06 17:40 EST (History)
1 user (show)

See Also:


Attachments
JPA projects (22.96 KB, application/x-zip-compressed)
2010-12-06 13:45 EST, Allan Zhang CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Allan Zhang CLA 2010-12-06 13:43:22 EST
Build Identifier: org.eclipse.jpt.core_2.3.2.v201008252310

You have a JPA Project X. Enums are defined in Project Y. JPA entities in
Project X are referencing these enums from Project Y. 

Generate DDL from entities will get the following error:

Caused by: java.lang.NoClassDefFoundError: com.ussco.base.enums.Application
    at java.lang.Class.getDeclaredFieldsImpl(Native Method)
    at java.lang.Class.getDeclaredFields(Unknown Source)
    at org.apache.openjpa.lib.util.J2DoPrivHelper$7.run(Unknown Source)
    at org.apache.openjpa.lib.util.J2DoPrivHelper$7.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Unknown Source)
    at org.apache.openjpa.persistence.PersistenceMetaDataDefaults.
determineImplicitAccessType
    at org.apache.openjpa.persistence.PersistenceMetaDataDefaults.
determineAccessType
    at org.apache.openjpa.persistence.PersistenceMetaDataDefaults.
populate
    at org.apache.openjpa.meta.MetaDataRepository.addMetaData(Unknown Source)
    at org.apache.openjpa.meta.MetaDataRepository.addMetaData(Unknown Source)
    at org.apache.openjpa.persistence.AnnotationPersistenceMetaDataParser.
getMetaData
    at org.apache.openjpa.persistence.AnnotationPersistenceMetaDataParser.
parseClassAnnotations
    at org.apache.openjpa.persistence.AnnotationPersistenceMetaDataParser.
parse
    at org.apache.openjpa.persistence.PersistenceMetaDataFactory.load
    at org.apache.openjpa.meta.MetaDataRepository.getMetaDataInternal
    at org.apache.openjpa.meta.MetaDataRepository.getMetaDataInternal
    at org.apache.openjpa.meta.MetaDataRepository.getMetaData(Unknown Source)
    at org.apache.openjpa.jdbc.meta.MappingRepository.getMapping
    at org.apache.openjpa.jdbc.meta.MappingTool.getMapping(Unknown Source)
    at org.apache.openjpa.jdbc.meta.MappingTool.buildSchema(Unknown Source)
    at org.apache.openjpa.jdbc.meta.MappingTool.run(Unknown Source)
    at org.apache.openjpa.jdbc.meta.MappingTool.run(Unknown Source)
    at org.apache.openjpa.jdbc.meta.MappingTool.run(Unknown Source)
    at org.apache.openjpa.jdbc.meta.MappingTool$1.run(Unknown Source)
    at org.apache.openjpa.lib.conf.Configurations.launchRunnable
    at org.apache.openjpa.lib.conf.Configurations.runAgainstAllAnchors
    at org.apache.openjpa.jdbc.meta.MappingTool.main(Unknown Source)

If you move these enums into the JPA Project X along with the entities
referncing them it works fine and DDL is generated without any problems. 
Looks like the Entity generating tool cannot identify project references. 

Note this problem is only with enums, It works fine with other types referenced
from external projects.


Reproducible: Always
Comment 1 Allan Zhang CLA 2010-12-06 13:45:54 EST
Created attachment 184647 [details]
JPA projects
Comment 2 Allan Zhang CLA 2010-12-06 13:47:30 EST
I have attached the sample JPA projects that can reproduce the NoClassDefFoundError.
Comment 3 Neil Hauge CLA 2010-12-06 13:59:48 EST
I think this is a problem with an adopter extension, as this functionality (Table Generation) is completely platform based.
Comment 4 Allan Zhang CLA 2010-12-06 17:03:56 EST
Thanks Neil, sorry for the confusion.