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

Bug 321694

Summary: EvaluationException/ClassCastException: java.lang.String cannot be cast to java.lang.Long when using generic MappedSuperclass
Product: z_Archived Reporter: Andreas Steinwachs <andreas>
Component: EclipselinkAssignee: Guy Pelletier <guy.pelletier>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: andreas, eclipselink.orm-inbox, guy.pelletier, michael.f.obrien
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on: 312132    
Bug Blocks:    
Attachments:
Description Flags
The stack trace
none
The test case none

Description Andreas Steinwachs CLA 2010-08-04 06:49:55 EDT
Build Identifier: Bundle-Version: 2.0.1.v20100213-r6600 on GlassFish v3.0.1

First of all, I'm pretty sure that this issue is related to Bug 312132 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=312132). However I thought that it was better to open a separate entry in order to not introduce confusion as this one leads to a different exception.

I'm using GlassFish v3.0.1.

The exception:

javax.faces.el.EvaluationException: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Long

This exception appears when calling entity.getId() when getId() is a public method of a generic MappedSuperclass that returns a generic IdType.

Please refer to the files attached for more information.

Reproducible: Always

Steps to Reproduce:
Please see the attached files stacktrace.txt and testcase.txt for a description on how to reproduce the issue.
Comment 1 Andreas Steinwachs CLA 2010-08-04 06:52:14 EDT
Created attachment 175825 [details]
The stack trace
Comment 2 Andreas Steinwachs CLA 2010-08-04 06:53:22 EDT
Created attachment 175826 [details]
The test case
Comment 3 Andreas Steinwachs CLA 2010-08-04 09:15:48 EDT
F
Comment 4 Andreas Steinwachs CLA 2010-08-04 09:17:13 EDT
Changed the headline as it doesn't really matter if there's a one to one relationship involved, it's rather the generic mapped super class id that seems to be the problem.
Comment 5 Guy Pelletier CLA 2010-08-16 14:35:30 EDT
I was unable to reproduce this error off the 2.2 stream.

I was able to reproduce it off the 2.1.1 stream however.

Therefore, I suspect the following bug fix corrected this issue as well, BUG 312132

Nightly builds can be downloaded here:

http://www.eclipse.org/eclipselink/downloads/nightly.php
Comment 6 Andreas Steinwachs CLA 2010-08-20 07:34:03 EDT
Thanks Guy, I have tried the 2.2 stream and it seems to work so far, but as I ran into a couple of other issues I will have to reconfirm later.
Comment 7 Andreas Steinwachs CLA 2010-09-15 14:20:14 EDT
Well, so far this issue seems to be resolved in deed. May be closed in my opinion.
Comment 8 Guy Pelletier CLA 2010-09-15 14:28:11 EDT
Fixed in the latest streams.
Comment 9 Eclipse Webmaster CLA 2022-06-09 10:06:02 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink