Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 331928

Summary: Entity generating tool cannot identify project references with enums
Product: [WebTools] Dali JPA Tools Reporter: Allan Zhang <zhang>
Component: GeneralAssignee: dali.general-inbox <dali.general-inbox>
Status: CLOSED INVALID QA Contact:
Severity: major    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Projects that can produce the error none

Description Allan Zhang CLA 2010-12-06 12:58:23 EST
Build Identifier: org.eclipse.jpt.core_2.3.2.v201008252310.jar

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(Unknown Source)
	at org.apache.openjpa.persistence.PersistenceMetaDataDefaults.determineAccessType(Unknown Source)
	at org.apache.openjpa.persistence.PersistenceMetaDataDefaults.populate(Unknown Source)
	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(Unknown Source)
	at org.apache.openjpa.persistence.AnnotationPersistenceMetaDataParser.parseClassAnnotations(Unknown Source)
	at org.apache.openjpa.persistence.AnnotationPersistenceMetaDataParser.parse(Unknown Source)
	at org.apache.openjpa.persistence.PersistenceMetaDataFactory.load(Unknown Source)
	at org.apache.openjpa.meta.MetaDataRepository.getMetaDataInternal(Unknown Source)
	at org.apache.openjpa.meta.MetaDataRepository.getMetaDataInternal(Unknown Source)
	at org.apache.openjpa.meta.MetaDataRepository.getMetaData(Unknown Source)
	at org.apache.openjpa.jdbc.meta.MappingRepository.getMapping(Unknown Source)
	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(Unknown Source)
	at org.apache.openjpa.lib.conf.Configurations.runAgainstAllAnchors(Unknown Source)
	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:01:43 EST
Created attachment 184643 [details]
Projects that can produce the error

I have attached the Projects that can reproduce the error.
Comment 2 Allan Zhang CLA 2010-12-06 13:36:31 EST
Incorrect attachment.