NullPointerException when creating SessionFactory,
September 25, 2009 at 5:37 AM
Hi, For those of u who r getting NullPointerException while creating sessionfactory (SessionFactory sf = new Configuration().configure().buildSessionFactory();) import all required jar files.. View the readme file in lib directory to get the list of required jar files. log4j jar file is also required. Otherwise creating new configuration will fail and it goes to finally block where session object is null and u get NullPointerException.