[ https://issues.apache.org/jira/browse/OPENJPA-457?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Pinaki Poddar reassigned OPENJPA-457: ------------------------------------- Assignee: Pinaki Poddar > ClassCastException in Filters.convert > ------------------------------------- > > Key: OPENJPA-457 > URL: https://issues.apache.org/jira/browse/OPENJPA-457 > Project: OpenJPA > Issue Type: Bug > Affects Versions: 0.9.7, 1.0.0, 1.0.1 > Environment: openjpa 0.9.7, Sun JDK 1.5.0_12, MySQL 5.0.45, Ubuntu Linux 7.1 > Reporter: Anil Gangolli > Assignee: Pinaki Poddar > > 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 Long.class. > 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(Filters.java:292) > at org.apache.openjpa.jdbc.kernel.exps.UnaryOp.load(UnaryOp.java:110) > at org.apache.openjpa.jdbc.kernel.ProjectionResultObjectProvider.getResultObject(ProjectionResultObjectProvider.java:76) > at org.apache.openjpa.lib.rop.EagerResultList.(EagerResultList.java:36) > at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1219) > at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:987) > at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:796) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.