Bug 538137 - CLASSCASTEXCEPTION WHEN CALLING STORED PROCEDURE TO GET LIST OF NUMBERS
Summary: CLASSCASTEXCEPTION WHEN CALLING STORED PROCEDURE TO GET LIST OF NUMBERS
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-21 18:19 EDT by Ravi Babu Tummuru CLA
Modified: 2022-06-09 10:06 EDT (History)
1 user (show)

See Also:


Attachments
A Simple Test Case (13.19 KB, application/x-zip-compressed)
2018-08-21 18:21 EDT, Ravi Babu Tummuru CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ravi Babu Tummuru CLA 2018-08-21 18:19:12 EDT
Eclipselink 2.6.3 is used in a production environment.  It was found that
java.lang.ClassCastException was reported while calling stored procedure to
get list of numbers.

Diagnostic Analysis
===================
EL 2.6.3 + JDK 1.8 + JDBC 12.1.0.2.0 + Oracle DB 11g

Provide Error Details
=====================
java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to
java.lang.Number
Comment 1 Ravi Babu Tummuru CLA 2018-08-21 18:21:51 EDT
Created attachment 275478 [details]
A Simple Test Case
Comment 2 Ravi Babu Tummuru CLA 2018-08-21 18:24:43 EDT
I am able to run the test success with the following change.

git diff
diff --git
a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/queries/
ResultSetMappingQuery.java
b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/queries/
ResultSetMappingQuery.java
index 324b86a..6454117 100644
---
a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/queries/
ResultSetMappingQuery.java
+++
b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/queries/
ResultSetMappingQuery.java
@@ -254,7 +254,7 @@ protected List buildObjectsFromRecords(List
databaseRecords, SQLResultSetMapping
             }
             for (Iterator iterator = databaseRecords.iterator();
iterator.hasNext();) {
                 DatabaseRecord record = (DatabaseRecord)iterator.next();
-                results.add(record.values().toArray());
+                results.add(record.getValues().get(0));
             }
         } else {
             for (Iterator iterator = databaseRecords.iterator();
iterator.hasNext();) {
Comment 3 Eclipse Webmaster CLA 2022-06-09 10:06:27 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink