ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Grassi Fabio" <Fabio.Gra...@ggsinformatica.it>
Subject R: class cast exception
Date Thu, 07 Apr 2005 13:39:32 GMT
Where do you put you iBatis jar files? In common/lib, server/lib or WEB-INF/lib?

> -----Messaggio originale-----
> Da: Baldur Norddahl [mailto:bbn-ibatis@inaphone.com] 
> Inviato: giovedì 7 aprile 2005 15:36
> A: ibatis-user-java@incubator.apache.org
> Oggetto: class cast exception
> 
> 
> Hi,
> 
> 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
>         at 
> com.ibatis.db.sqlmap.MappedStatement.runQueryForObject(Unknown Source)
>         at 
> com.ibatis.db.sqlmap.MappedStatement.executeQueryForObject(Unk
> nown Source)
>         at 
> com.ibatis.db.sqlmap.MappedStatement.executeQueryForObject(Unk
> nown 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" 
> result-class="java.lang.String">
>     select game_id as value from webshop.game where id=#value#
>   </mapped-statement>
> 
> And the code that invokes it:
> 
> String gameId = 
> SqlConfig.webshop.executeQueryForObject("getGameIdByContentId"
> ,contentid.toString()).toString();
> 
> 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:
> 
>    <datasource 
> factory-class="com.ibatis.db.sqlmap.datasource.JndiDataSourceFactory" 
> name="webshop" default="true">
>       <property name="DBFullJndiContext" 
> value="java:comp/env/jdbc/db"/>
>    </datasource>
> 
> I hope somebody got an idea for me how I can go about fixing this.
> 
> Thanks,
> 
> Baldur
> 
> 
Ai sensi del D.Lgs. 196/2003 si precisa che le informazioni contenute in questo messaggio
sono riservate ed a uso esclusivo del destinatario. Qualora il messaggio in parola Le fosse
pervenuto per errore, La invitiamo ad eliminarlo senza copiarlo e a non inoltrarlo a terzi,
dandocene gentilmente comunicazione. Grazie.<BR><BR>Pursuant to Legislative Decree
No. 196/2003, you are hereby informed that this message contains confidential information
intended only for the use of the addressee. If you are not the addressee, and have received
this message by mistake, please delete it and immediately notify us. You may not copy or disseminate
this message to anyone. Thank you.
Mime
View raw message