These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Exception in Hibernate
PostPosted: Wed Apr 27, 2005 8:35 am 
Beginner
Beginner

Joined: Wed Apr 27, 2005 8:27 am
Posts: 27
Hi everyone,

I'm trying to execute the method findByPrimaryKey (Class classe, Serializable primaryKey), passing as argument an object wich identifier is a String.
I've already checked the Hibernate.cfg.xml, the xml file of the object and it does not seem to have any problem.
the bank is Oracle. The exception that occurs in the moment of the query is below:

java.lang.ClassCastException
net.sf.hibernate.type.StringType.toString(StringType.java:47)
net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:46)
net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:35)
net.sf.hibernate.loader.Loader.bindPositionalParameters(Loader.java:674)
net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:713)
net.sf.hibernate.loader.Loader.doQuery(Loader.java:185)
net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
net.sf.hibernate.loader.Loader.loadEntity(Loader.java:836)
net.sf.hibernate.loader.Loader.loadEntity(Loader.java:856)
net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:59)
net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:51)
net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:419)
net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:2106)
net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1980)
net.sf.hibernate.impl.SessionImpl.get(SessionImpl.java:1916)
br.org.df.codeplan.sigterra.dao.BaseDAO.findByPrimaryKey(BaseDAO.java:129)
br.org.df.codeplan.sigterra.dao.ContabilDAO.findConta(ContabilDAO.java:52)
br.org.df.codeplan.sigterra.facade.ContabilFacade.findConta(ContabilFacade.java:65)
br.org.df.codeplan.sigterra.struts.contabil.realizaLancamentoManual.RealizaLancamentoManualAction.chamaPaginaInformarValor(RealizaLancamentoManualAction.java:50)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:324)
org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

If anyone has already had this problem, would please help me? What are the possible reasons for this exception occurs?

Thank you, Guilherme


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.