openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anil Gangolli (JIRA)" <>
Subject [jira] Created: (OPENJPA-457) ClassCastException in Filters.convert
Date Sun, 02 Dec 2007 23:31:43 GMT
ClassCastException in Filters.convert

                 Key: OPENJPA-457
             Project: OpenJPA
          Issue Type: Bug
    Affects Versions: 1.0.1, 1.0.0, 0.9.7
         Environment: openjpa 0.9.7, Sun JDK 1.5.0_12, MySQL 5.0.45, Ubuntu Linux 7.1
            Reporter: Anil Gangolli

I am seeing this problem in 0.9.7 but examination of trunk code suggests that the same bug
is still present in current trunk.

The exception occurs when Filters.convert(o,type) is called with o of class String and type

This leads to a ClassCastException at line 292 where o is cast to Number.  

The same path seems to be reached for any type assignable from Number, except Integer.class
which is handled in a separate case at line 275.

Example stacktrace fragment:

Caused by: java.lang.ClassCastException: java.lang.String
        at org.apache.openjpa.kernel.Filters.convert(
        at org.apache.openjpa.jdbc.kernel.exps.UnaryOp.load(
        at org.apache.openjpa.jdbc.kernel.ProjectionResultObjectProvider.getResultObject(
        at org.apache.openjpa.lib.rop.EagerResultList.<init>(
        at org.apache.openjpa.kernel.QueryImpl.toResult(
        at org.apache.openjpa.kernel.QueryImpl.execute(
        at org.apache.openjpa.kernel.QueryImpl.execute(

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message