-->
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.  [ 13 posts ] 
Author Message
 Post subject: id to load is required for loading - Error
PostPosted: Sun Jan 15, 2006 10:11 pm 
Newbie

Joined: Sun Jan 15, 2006 8:26 pm
Posts: 9
Please help:



Hibernate version:3.0
Name and version of the database you are using :oracle 9i




java.lang.IllegalArgumentException: id to load is required for loading
at org.hibernate.event.LoadEvent.<init>(LoadEvent.java:51)
at org.hibernate.event.LoadEvent.<init>(LoadEvent.java:33)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:618)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:614)
at com.dcf.dataAccess.FLunearnedincomesummaryDALC.getProfileByPrimaryKey(FLunearnedincomesummaryDALC.java:105)
at com.dcf.struts.action.ScrFLUnEarnedIncomeSummaryAction.init(ScrFLUnEarnedIncomeSummaryAction.java:327)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:274)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:194)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:534)
com.dcf.utils.AccessException
at com.dcf.dataAccess.FLunearnedincomesummaryDALC.getProfileByPrimaryKey(FLunearnedincomesummaryDALC.java:112)
at com.dcf.struts.action.ScrFLUnEarnedIncomeSummaryAction.init(ScrFLUnEarnedIncomeSummaryAction.java:327)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:274)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:194)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:534)


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 15, 2006 10:20 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
You're passing null to Session().get(). You can't get null.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 15, 2006 11:02 pm 
Newbie

Joined: Sun Jan 15, 2006 8:26 pm
Posts: 9
This error comes only when we use
the LOADRUNNER tool. Under normal conditions
everything works fine.

_________________
Ramesh


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 15, 2006 11:46 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
I presume that that's an Hibernate tool. Perhaps you could ask your question over on the Tools forum.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 16, 2006 2:02 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
so you have mapped the id to a column which dont have data...?

(p.s. loadrunner is not a hibernatetool, I think it is some stresstesting tool they are using)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 16, 2006 8:03 am 
Newbie

Joined: Sun Jan 15, 2006 8:26 pm
Posts: 9
The id's are created automatically by the oracle sequences.

This error happens when there are lot of concurrent users
are put into work through load runner.Otherwise it works fine.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 16, 2006 12:37 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
so you are most likely using the session unsafely - they are not threadsafe, so only use them in one thread at one time.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 16, 2006 12:44 pm 
Newbie

Joined: Sun Jan 15, 2006 8:26 pm
Posts: 9
How do i do that?..
Any settigs to be done in hibernat.cfg.xml?.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 16, 2006 12:50 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
huh ? no settings needed/possible.

just ensure that your software is written so you don't use the same session in multiple threads.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 16, 2006 1:04 pm 
Newbie

Joined: Sun Jan 15, 2006 8:26 pm
Posts: 9
I guess we are already doing that.
Any other ideas?..

Is the following property is of any useful?.

<property name="current_session_context_class">thread</property>


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 17, 2006 4:29 am 
Regular
Regular

Joined: Tue Dec 14, 2004 5:21 am
Posts: 104
Location: india
Quote:
just ensure that your software is written so you don't use the same session in multiple threads.

you may try to use a "ThreadLocal" sessions .

_________________
sHeRiN
thanks for your ratings ...... :)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 17, 2006 9:51 am 
Newbie

Joined: Sun Jan 15, 2006 8:26 pm
Posts: 9
We are already doing that...

_________________
Ramesh


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 17, 2006 4:58 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
You probably don't want to use ThreadLocal sessions, as that implies long-lived sessions, which have separate issues that you'll need to carefully manage. Use ThreadLocal SessionFactories, and get/release sessions as needed.

That won't solve your null id problem though. You'll have to debug that one yourself.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 13 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.