Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 313799 - Null text range exception with generator in both orm.xml and eclipselink-orm.xml
Summary: Null text range exception with generator in both orm.xml and eclipselink-orm.xml
Status: VERIFIED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: General (show other bugs)
Version: 2.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 2.3.1   Edit
Assignee: Karen Butzke CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-20 15:18 EDT by Karen Butzke CLA
Modified: 2010-07-23 10:27 EDT (History)
2 users (show)

See Also:
neil.hauge: review+


Attachments
proposed patch against head (3.13 KB, patch)
2010-06-18 12:03 EDT, Karen Butzke CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Karen Butzke CLA 2010-05-20 15:18:06 EDT
Create an EclipseLink project with an orm.xml file and an eclipselink-orm.xml file.  Add the following java entity to the project and specify the entity in both the orm.xml file and eclipse-orm.xml file. Save the files. When the validation runs it will hit the below IllegalArgumentException.  The exception is logged and the validation continues. The error still appears just with no location info inside the file. This is an incorrect validation since the generator in question is being defaulted in to the mappings files.


@Entity
public class Employee {
    @Id
    @GeneratedValue(strategy=SEQUENCE, generator="EMPLOYEE_SEQUENCE_GENERATOR")
    @SequenceGenerator(name="EMPLOYEE_SEQUENCE_GENERATOR", sequenceName="EMPLOYEE_SEQ", allocationSize=10)
	private int id;
}



java.lang.IllegalArgumentException: Null text range for message ID: GENERATOR_DUPLICATE_NAME
at org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages.buildMessage(DefaultJpaValidationMessages.java:51)
at org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmGeneratorContainer.validateGenerators(GenericOrmGeneratorContainer.java:189)
at org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmGeneratorContainer.validate(GenericOrmGeneratorContainer.java:180)
at org.eclipse.jpt.core.internal.context.orm.AbstractOrmIdMapping.validate(AbstractOrmIdMapping.java:362)
Comment 1 Karen Butzke CLA 2010-06-18 12:03:09 EDT
Created attachment 172226 [details]
proposed patch against head

This patch changes the Generator.duplicates(Generator) logic such that a virtual generator is not a duplicate of another generator. This patch does not solve the problem where a generator is specified in both the orm.xml file and the eclipselink-orm.xml file as this is a larger bug about the eclipselink-orm.xml being an override of all other mappings files (bug 251237)
Comment 2 Karen Butzke CLA 2010-06-24 14:53:41 EDT
resolved in HEAD for 2.3.1 maintenance
Comment 3 Jolene Moffitt CLA 2010-07-23 10:24:51 EDT
Verified in wtp-R3.2.1-M: M-3.2.1-20100716070539 build, by creating a project, adding the documented entity and adding it to the eclipse-orm.xml and orm.xml files.  The error no longer appears.