Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 321694 - EvaluationException/ClassCastException: java.lang.String cannot be cast to java.lang.Long when using generic MappedSuperclass
Summary: EvaluationException/ClassCastException: java.lang.String cannot be cast to ja...
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Guy Pelletier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 312132
Blocks:
  Show dependency tree
 
Reported: 2010-08-04 06:49 EDT by Andreas Steinwachs CLA
Modified: 2022-06-09 10:06 EDT (History)
4 users (show)

See Also:


Attachments
The stack trace (3.07 KB, text/plain)
2010-08-04 06:52 EDT, Andreas Steinwachs CLA
no flags Details
The test case (1.50 KB, text/plain)
2010-08-04 06:53 EDT, Andreas Steinwachs CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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