-->
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.  [ 3 posts ] 
Author Message
 Post subject: cannot connect to db through hibernate
PostPosted: Thu Mar 17, 2005 6:14 am 
Newbie

Joined: Thu Mar 17, 2005 5:58 am
Posts: 4
Hi,
I am trying to connect to hibernate 2.0.But before even starting the transaction it is throwing a error.
Mapping documents:

<hibernate-mapping>
<class name="com.unilever.app.container.IncidentInfo" table="SEC_INCIDENT">
<id name="iRecordId" type="int" column="REC_ID" unsaved-value="0">
<generator class="native"/>
</id>
<property name="iAuthor" column="AUTHOR" not-null="true" type="int"/>
<property name="sIncidentNumber" column="INCIDENT_NUMBER" not-null="true" type="string"/>
<property name="iIncidentType" column="INCIDENT_TYPE" not-null="true" type="int"/>
<property name="iScope" column="SCOPE" not-null="true" type="int"/>
<property name="dIncidentDate" column="INCIDENT_DATE" not-null="false" type="date"/>
<property name="sIncidentTime" column="INCIDENT_TIME" not-null="false" type="string"/>
<property name="iStatus" column="INCIDENT_STATUS" not-null="true" type="int"/>
<property name="iSite" column="INCIDENT_SITE" not-null="true" type="int"/>
<property name="sEnteredBy" column="ENTERED_BY" not-null="false" type="string"/>
<property name="sEscalatedTo" column="ESCALATED_TO" not-null="false" type="string"/>
<property name="sDetails" column="INCIDENT_DETAILS" not-null="false" type="string"/>

</class>
</hibernate-mapping>

_----------------------------------------------------------------------------------

code being called :

s = DefaultSessionFactory.getInstance().openSession();
tx = s.beginTransaction();
s.save(objIncidentInfo);
s.flush();

--------------------------------------------------------------------

version of db : Oracle 8i

The output is shown below.

2005-03-17 14:49:32,144 ERROR [web-0] db.DefaultSessionFactory (DefaultSessionFactory.java:107) - ConfigFile Path is /secinchib.cfg.xml
2005-03-17 14:49:33,082 ERROR [web-0] db.DefaultSessionFactory (DefaultSessionFactory.java:113) - DefaultSessionFactory::getSessnet.sf.hiber
nate.PropertyNotFoundException: Could not find a setter for property iRecordId in class com.unilever.app.container.IionFactory Could not fin
d a setter for property iRecordId in class com.unilever.app.container.IncidentInfo
ncidentInfo
at net.sf.hibernate.property.BasicPropertyAccessor.getSetter(BasicPropertyAccessor.java:131)
at net.sf.hibernate.mapping.Property.getSetter(Property.java:182)
at net.sf.hibernate.persister.AbstractEntityPersister.<init>(AbstractEntityPersister.java:565)
at net.sf.hibernate.persister.EntityPersister.<init>(EntityPersister.java:741)
at net.sf.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:41)
at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:136)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:720)
at com.unilever.app.db.DefaultSessionFactory.getSessionFactory(DefaultSessionFactory.java:108)
at com.unilever.app.db.DefaultSessionFactory.getInstance(DefaultSessionFactory.java:84)
at com.unilever.app.db.IncidentInfoDB.addIncidentInfo(IncidentInfoDB.java:88)
at com.unilever.app.controller.IncidentInfoMgr.addIncidentInfo(IncidentInfoMgr.java:81)
at com.unilever.app.client.IncidentInfoClient.addIncidentInfo(IncidentInfoClient.java:124)
at com.unilever.app.servlets.IncidentController.doPost(IncidentController.java:228)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:852005-03-17 14:49:33,144 ERROR [web-0] db.IncidentInfoDB (IncidentInfoDB
.java:143) - IncidentInfoIdGenerator ::getNextID DefaultS3)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChaiessionFactory:: getSessionFactoryCould not find a setter for property iRe
cordId in class com.unilever.app.container.IncidentInfon.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:252)
at jrun.servlet.ServletEngineService
.dispatch(ServletEngineService.java:527)
at jrun.servlet.http.WebService.invokeRunnable(WebService.java:168)
at jrunx.schedu2005-03-17 14:49:33,160 ERROR [web-0] controller.IncidentInfoMgr (IncidentInfoMgr.java:85) - IncidentInfoMgr :: addIn
cidentInfo(ler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:451)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
)Exception DefaultSessionFactory:: getSessionFactoryCould not find a setter for property iRecordId in class com.unilever.app.container.Incid
entInfo



Please guide in this regard.

Thanks,
sreedhar


Top
 Profile  
 
 Post subject: cannot connect to db through hibernate
PostPosted: Thu Mar 17, 2005 8:28 am 
Newbie

Joined: Thu Mar 17, 2005 7:50 am
Posts: 8
Location: Tunis
Quote:
getSessionFactoryCould not find a setter for property iRecordId in class com.unilever.app.container.Incid


Hi sreedharp !!!
Be sure you have defined a setter for iRecordId property.
Walid.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 18, 2005 3:06 am 
Newbie

Joined: Thu Mar 17, 2005 5:58 am
Posts: 4
Thanks a lot.
The matter was solved.

regards
sreedhar


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

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.