Im very sorry for not stating my problem. Sorry again friends!!!!
Problem
=======
I couldnt have my sessionFactory created using these hbm files. I get no exception when I use the following code, and I get no Factory too. ie,
try{
Configuration cfg=new Configuration();
System.out.println("About to build session factory....");
factory=cfg.configure().buildSessionFactory(); //// this line is not executed or even throws exception as would normally if something went wrong
System.out.println("Session Factory is :"+factory);
if(factory!=null)
{
getServletContext().setAttribute("FACTORY",factory);
System.out.println("Session factory is kept in application context (NEW STYLE-WORKING WELL)");
}
}catch(Exception e)
{
System.out.println("EXCEPTION while trying to store in application context :"+e);
}
In this code, I get no exception as well as dont get Session factory too. My program doesnt throw even an exception. Once it printed 'About to build session factory.. it ignores the rest.
But if I remove the <set > tag from User.hbm.xml file, it creates sessionFactory well.
Please help.
|