ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Baldur Norddahl <bbn-iba...@inaphone.com>
Subject class cast exception
Date Thu, 07 Apr 2005 13:35:58 GMT

In some of our projects we are haunted by a strange class cast 
exception. I suspect it is a class loader issue. Just after restarting 
the application server everything works fine, and it may continue to 
work fine for hours or days. Until suddenly it stops working with this 
kind of errors:

2005-04-07 14:39:15,564 [TP-Processor112] ERROR 
com.ibatis.db.sqlmap.MappedStatement  - Error executing 
'getGameIdByContentId' in 'com/xentive/shopdb/webshop.xml'. Check the 
Parameter Map (or inline parameters).  Check the 'value' property. 
Cause: java.lang.ClassCastException: java.lang.String
java.lang.ClassCastException: java.lang.String
com.ibatis.db.sqlmap.MappedStatement.runQueryForObject(Unknown Source)
com.ibatis.db.sqlmap.MappedStatement.executeQueryForObject(Unknown Source)
com.ibatis.db.sqlmap.MappedStatement.executeQueryForObject(Unknown Source)
        at com.ibatis.db.sqlmap.SqlMap.executeQueryForObject(Unknown Source)
        at com.xentive.shopdb.OrderHandler.doGet(OrderHandler.java:123)

The statement looks like this:

  <mapped-statement name="getGameIdByContentId" 
    select game_id as value from webshop.game where id=#value#

And the code that invokes it:

String gameId = 

Restarting the application server always fixes the problem for a while.

Usually we can "fix" the problem applications by converting everything 
to strings. That did not work in this case though.

We are using:

postgresql 7.4.3
tomcat 5.0.27
jdk 1.5.0

The datasource is a global shared pool:

name="webshop" default="true">
      <property name="DBFullJndiContext" value="java:comp/env/jdbc/db"/>

I hope somebody got an idea for me how I can go about fixing this.



View raw message