-->
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: "The session factory has not been initialized..."
PostPosted: Mon Aug 22, 2005 12:38 pm 
Newbie

Joined: Thu Aug 18, 2005 7:48 am
Posts: 5
Location: Paris
I use DAO's and the _BaseRootDAO class created by HibernateSynchronizer3. I coded HibernateSessionFactory, and the mapping file hibernate.cfg.xml is in the classpath.

Hibernate version: 3.0.5

Mapping documents: /hibernate.cfg.xml in the classpath

Code between sessionFactory.openSession() and session.close():
Code:
_RootDAO.initialize();
leGerant = fr.integrance.hibernate.dao.GerantsDAO.getInstance().getGerantByLogin(login);


Full stack trace of any exception that occurs:
Code:
java.lang.RuntimeException: The session factory has not been initialized (or an error occured during initialization)
   at fr.integrance.hibernate._BaseRootDAO.getSessionFactory(_BaseRootDAO.java:104)
   at fr.integrance.hibernate._BaseRootDAO.getSession(_BaseRootDAO.java:155)
   at fr.integrance.hibernate._BaseRootDAO.getSession(_BaseRootDAO.java:126)
   at fr.integrance.hibernate._BaseRootDAO.get(_BaseRootDAO.java:260)
   at fr.integrance.modele.gerants.base.BaseGerantsDAO.get(BaseGerantsDAO.java:44)
   at fr.integrance.modele.gerants.Gerant.<init>(Gerant.java:79)
   at fr.integrance.struts.action.LoginAction.execute(LoginAction.java:60)
   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.doPost(ActionServlet.java:432)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
   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:213)
   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:856)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
   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:595)


What's more, I don't understand how _BaseRootDAO can find the session factory calss (usually HibernateUtil or HibernateSessionFactory). Would it be possible to have a clue on that?

Is it useful to put the factory class name in the config file ?
Code:
<session-factory name="fr.integrance.hibernate.HibernateSessionFactory">


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 23, 2005 3:56 am 
Newbie

Joined: Thu Aug 18, 2005 7:48 am
Posts: 5
Location: Paris
Sorry to up the subject, but I'm really in big trouble as I can't even launch my webapp! Nothing, I really say nothing is displayed in the console and debug breakpoints are totally useless!
It sounds like no code is being launched, and the exception is throwed right away...
Any idea about how to configure the _BaseRootDAO from Hibernate Synchronizer?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 23, 2005 4:12 am 
Newbie

Joined: Sat Aug 20, 2005 10:58 am
Posts: 4
_RootDAO.initialize() should be called before sessionFactory.openSession(). Moreover, use _BaseRootDAO.getSession() to get a Session instead.


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.