Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 314541 - IllegalArgumentException with editing some eclipselink properties in source persistence.xml
Summary: IllegalArgumentException with editing some eclipselink properties in source p...
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: Tran Le CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-26 13:52 EDT by Karen Butzke CLA
Modified: 2010-07-20 09:07 EDT (History)
1 user (show)

See Also:


Attachments
proposed patch (7.06 KB, text/plain)
2010-06-24 14:46 EDT, Tran Le CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Karen Butzke CLA 2010-05-26 13:52:45 EDT
Type any of these properties in to the persistence.xml source of an EclipseLink persistence.xml:
<property name="eclipselink.cache.type." value=""/>
<property name="eclipselink.cache.size." value=""/>
<property name="eclipselink.cache.type." value=""/>
<property name="eclipselink.descriptor.customizer." value=""/>


java.lang.IllegalArgumentException
	at org.eclipse.jpt.eclipselink.core.internal.context.persistence.caching.Entity.initialize(Entity.java:50)
	at org.eclipse.jpt.eclipselink.core.internal.context.persistence.caching.Entity.<init>(Entity.java:41)
	at org.eclipse.jpt.eclipselink.core.internal.context.persistence.caching.EclipseLinkCaching.buildEntity(EclipseLinkCaching.java:521)
Comment 1 Neil Hauge CLA 2010-06-09 17:39:28 EDT
Investigate for 2.3.1.
Comment 2 Tran Le CLA 2010-06-24 14:46:15 EDT
Created attachment 172663 [details]
proposed patch
Comment 3 Neil Hauge CLA 2010-06-30 13:40:52 EDT
Patch committed in 2.3.1 and head.
Comment 4 Neil Hauge CLA 2010-06-30 13:42:39 EDT
Patch committed in 2.3.1 and head.
Comment 5 Neil Hauge CLA 2010-06-30 13:43:36 EDT
Patch committed in 2.3.1 and head.
Comment 6 Neil Hauge CLA 2010-07-14 10:40:44 EDT
I discovered that this IllegalArgumentException is still encountered when building a project with this content.  This can be reproduced by opening a project with the below persistence.xml from a closed state, or a project clean should also reproduce.

This prevents the project from being built, which results in a non-functional Dali environment.
Comment 7 Neil Hauge CLA 2010-07-14 16:56:43 EDT
To reproduce:

-Create a 2.1 EL project
-Open persistence.xml editor
-Create a Descriptor Customizer for an entity and enter a customizer class on the Customizer tab <save>
-Edit the source by removing the entity class name from the the property "name" string <save>
-close the project
-open the project

java.lang.IllegalArgumentException
at org.eclipse.jpt.eclipselink.core.internal.context.persistence.customization.Entity.initialize(Entity.java:45)
...

Project fails to build, and cannot be built until the above persistence.xml is corrected.
Comment 8 Neil Hauge CLA 2010-07-14 17:00:50 EDT
This is the exact property text that is causing the failure for me:

<property name="eclipselink.descriptor.customizer." value="com.sun.org.apache.bcel.internal.generic.AALOAD"/>
Comment 9 Tran Le CLA 2010-07-14 21:06:10 EDT
That's an odd case, and an easy fix. 
I have checkin a fix so it won't block the building of the project. But there is a problem now if you edit the source and give an Entity name, you could end up with multiple dummy Entities in the Customization tab. We lost our way to detect when a Descriptor Customizer property is in the middle of being entered.
The good thing is that these dummy Entities will disappear the next time the project is built. You have the same problem if you try to rename an Entity in the source tab.
Comment 10 Tran Le CLA 2010-07-14 21:29:08 EDT
Committed in 2.3.1 and head.
Comment 11 Karen Butzke CLA 2010-07-20 09:07:21 EDT
verified fixed in build wtp-sdk-M-3.2.1-20100716070539