-->
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: after buildSessionFactory(),get a null sessionFactory
PostPosted: Wed Feb 11, 2004 8:58 am 
Newbie

Joined: Mon Feb 09, 2004 1:19 am
Posts: 1
i getting a NullPointerException when
trying get a session ,and i found it is because i got a null sessionFactory

i am new to hibernate, and now doing with a one-to-many case.
i am sure the connection to db is well, and web application can find the datasource........ i can see these from command line of tomcat:
using datasource: java:comv/env/jdbc/pim

so .... why the sessionFactory is null?

the code is:

try {
sessionFactory = (new Configuration()).configure().buildSessionFactory();
}catch(HibernateException he) {

}

i put all *.hbm.xml and hibernate.cfg.xml under classes.

help~~~~~~~~~~~~~~~~~~~


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 11, 2004 9:34 am 
Expert
Expert

Joined: Fri Nov 07, 2003 4:24 am
Posts: 315
Location: Cape Town, South Africa
Have you got a hibernate.cfg.xml or hibernate.properties file in the root of your classpath?

If the problem persists:
1) Read the documentation
2) enabled logging in your log4j.properties file (log4j.logger.net.sf.hibernate=debug) and post the trace.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 11, 2004 11:45 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
And put some feedback in the catch block !

_________________
Emmanuel


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.