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

Bug 325292

Summary: Usability Issue - Improve Error Message when incorrect value set on property
Product: z_Archived Reporter: Blaise Doughan <blaise.doughan>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: saurabh.arora
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Patch for providing better Error message. blaise.doughan: iplog+

Description Blaise Doughan CLA 2010-09-14 16:32:39 EDT

    
Comment 1 Blaise Doughan CLA 2010-09-14 16:36:12 EDT
Some users are finding the following error message "unfriendly":

[EclipseLink-3001] (Eclipse Persistence Services - 1.1.1.v20090430-r4097): 
org.eclipse.persistence.exceptions.ConversionExceptionException Description: 
The object [45!@#6], of class [class java.lang.String], could not be 
converted to [class java.lang.Long].Internal Exception: 
java.lang.NumberFormatException: For input string: "45!@#6" 

We could enhance this error message to something like:

Exception [EclipseLink-45041] (Eclipse Persistence Services - @VERSION@.@QUALIFIER@): org.eclipse.persistence.exceptions.SDOException 
Exception Description: The value [invalidNumber] of class [class java.lang.String] is invalid for property [salary] of type [commonj.sdo#Int]. 
Internal Exception: Exception [EclipseLink-3001] (Eclipse Persistence Services - @VERSION@.@QUALIFIER@): 
org.eclipse.persistence.exceptions.ConversionException 
Exception Description: The object [invalidNumber], of class [class 
java.lang.String], could not be converted to [class java.lang.Integer]. 
Internal Exception: java.lang.NumberFormatException: For input string: 
"invalidNumber" 
at 
org.eclipse.persistence.exceptions.SDOException.invalidPropertyValue(SDOException.java:329) 
at 
org.eclipse.persistence.sdo.SDODataObject.convertValueAndSet(SDODataObject.jav 
a:2114) 
at 
org.eclipse.persistence.sdo.SDODataObject.setString(SDODataObject.java:1094) 
at demo.Demo.main(Demo.java:16) 
Caused by: Exception [EclipseLink-3001] (Eclipse Persistence Services - 
@VERSION@.@QUALIFIER@): 
org.eclipse.persistence.exceptions.ConversionException 
Exception Description: The object [invalidNumber], of class [class 
java.lang.String], could not be converted to [class java.lang.Integer]. 
Internal Exception: java.lang.NumberFormatException: For input string: 
"invalidNumber"
Comment 2 Saurabh Arora CLA 2010-09-20 03:04:27 EDT
Created attachment 179222 [details]
Patch for providing better Error message.
Comment 3 Blaise Doughan CLA 2010-10-05 16:35:20 EDT
Code checked into trunk at rev:  8319
Code reviewed by:  Blaise Doughan
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:25:32 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink