| Summary: | Null text range exception with generator in both orm.xml and eclipselink-orm.xml | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [WebTools] Dali JPA Tools | Reporter: | Karen Butzke <karenfbutzke> | ||||
| Component: | General | Assignee: | Karen Butzke <karenfbutzke> | ||||
| Status: | VERIFIED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | jolene.moffitt, neil.hauge | ||||
| Version: | 2.3 | Flags: | neil.hauge:
review+
|
||||
| Target Milestone: | 2.3.1 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
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) resolved in HEAD for 2.3.1 maintenance 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. |
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)