I have an issue with a application which works fine on development environment (Tomcat + Oracle 10) but I get a class cast exception (see the log) on Integration(WAS + Oracle 9).
I'm wondering if it's the difference between the server (Tomcat vs WAS) or between the version of Oracle that cause the problem.
Any solution?
Many thanks for any info !
Hibernate version: 3.2.1
Mapping documents:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="xx.xx.model.reservation.CritereView"
lazy="false"
table="CRITERE"
dynamic-insert="true"
dynamic-update="true"
select-before-update="true"
optimistic-lock="version">
<!-- Identifiant unique assigné -->
<id name="id" column="CRITERE_ID" type="long">
<generator class="native">
<param name="sequence">CRT_SEQ</param>
</generator>
</id>
<!-- version -->
<version name="version" column="VERSION" type="integer" unsaved-value="null" />
<!-- Date Aller -->
<property name="dateAller" type="date" update="true" insert="true" column="DATE_ALLER"/>
<!-- Date Retour -->
<property name="dateRetour" type="date" update="true" insert="true" column="DATE_RETOUR"/>
<!-- Date Aller Fin -->
<property name="dateAllerFin" type="date" update="true" insert="true" column="DATE_ALLER_FIN"/>
<!-- Date Retour Fin -->
<property name="dateRetourFin" type="date" update="true" insert="true" column="DATE_RETOUR_FIN"/>
<!-- Indicateur -->
<property name="indicateur" type="integer" update="true" insert="true" column="INDICATEUR"/>
<!-- Ind Open -->
<property name="indOpen" type="boolean" update="true" insert="true" column="IND_OPEN"/>
<!-- Vehicule Aller -->
<property name="vehAller" type="boolean" update="true" insert="true" column="VEH_ALLER"/>
<!-- Vehicule Retour -->
<property name="vehRetour" type="boolean" update="true" insert="true" column="VEH_RETOUR"/>
<!-- Vehicule Tracte Aller -->
<property name="vehTracteAller" type="boolean" update="true" insert="true" column="VEH_TRACTE_ALLER"/>
<!-- Vehicule Tracte Retour -->
<property name="vehTracteRetour" type="boolean" update="true" insert="true" column="VEH_TRACTE_RETOUR"/>
<!-- Reseau -->
<component name="reseau" class="biz.sncm.model.reservation.ReseauView">
<property name="code" column="CODE_RESEAU"/>
</component>
<!-- Sens -->
<component name="sens" class="biz.sncm.model.reservation.SensView">
<property name="code" column="CODE_SENS"/>
</component>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
session.saveOrUpdate(critere);
Full stack trace of any exception that occurs:
ERROR [Servlet.Engine.Transports : 1] (DAOException.java:37)- Hibernate rollback : java.lang.String
java.lang.ClassCastException: java.lang.String
at org.hibernate.type.BooleanType.set(BooleanType.java:36)
at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:83)
at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:60)
at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:1947)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2193)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2604)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:52)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at biz.sncm.persistence.dao.reservation.hibernate.reservation.ReservationDAO.saveOrUpdate(ReservationDAO.java:121)
at biz.sncm.business.client.services.ServiceCompteClient.saveOrUpdateReservation(ServiceCompteClient.java:541)
at biz.sncm.travelfront.reserver.DossierDisplayAction.executeAction(DossierDisplayAction.java:260)
at biz.sncm.travelfront.framework.BaseNavigationAction.execute(BaseNavigationAction.java:86)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.ServicingServletState.service(StrictLifecycleServlet.java:333)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:1019)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:592)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:204)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:274)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:320)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.ServicingServletState.service(StrictLifecycleServlet.java:333)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:1019)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:592)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:204)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:274)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:320)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:1019)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:592)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:204)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:125)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:286)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:615)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439)
Name and version of the database you are using:
Oracle 9 & 10
The generated SQL (show_sql=true) whith log Hibernate.type enabled:
Hibernate: insert into CRITERE (VERSION, DATE_ALLER, INDICATEUR, IND_OPEN, VEH_ALLER, VEH_RETOUR, VEH_TRACTE_ALLER, VEH_TRACTE_RETOUR, CODE_RESEAU, CODE_SENS, CRITERE_ID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
[29/01/07 17:51:32:943 CET] 2bb8317b SystemOut O DEBUG [Servlet.Engine.Transports : 1] (AbstractBatcher.java:476)- preparing statement
[29/01/07 17:51:32:945 CET] 2bb8317b SystemOut O DEBUG [Servlet.Engine.Transports : 1] (AbstractEntityPersister.java:1942)- Dehydrating entity: [biz.sncm.model.reservation.CritereView#25]
[29/01/07 17:51:32:947 CET] 2bb8317b SystemOut O DEBUG [Servlet.Engine.Transports : 1] (NullableType.java:80)- binding '0' to parameter: 1
[29/01/07 17:51:32:950 CET] 2bb8317b SystemOut O DEBUG [Servlet.Engine.Transports : 1] (NullableType.java:80)- binding '08 mars 2007' to parameter: 2
[29/01/07 17:51:32:953 CET] 2bb8317b SystemOut O DEBUG [Servlet.Engine.Transports : 1] (NullableType.java:80)- binding '0' to parameter: 3
[29/01/07 17:51:32:955 CET] 2bb8317b SystemOut O DEBUG [Servlet.Engine.Transports : 1] (NullableType.java:80)- binding 'N' to parameter: 4
[29/01/07 17:51:32:958 CET] 2bb8317b SystemOut O INFO [Servlet.Engine.Transports : 1] (NullableType.java:87)- could not bind value 'N' to parameter: 4; java.lang.String
Debug level Hibernate log excerpt:
It may help,
here is my configuration:
hibernate.cfg.xml:
<?xml version='1.0' encoding='utf-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration> <session-factory>
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property> <property name="connection.datasource">java:comp/env/jdbc/oracle/clientsweb</property>
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property> ...
Last edited by bjorn.dunk on Mon Jan 29, 2007 1:00 pm, edited 1 time in total.
|