Finally, got it resolved.
The below code fragment doesn't work
Code:
Configuration cfg = new Configuration().configure();
cfg.setProperties(System.getProperties());
SessionFactory sessions = cfg.buildSessionFactory();
However, if i change the point at which configure is called to after the setProperties call, it works.
Code:
Configuration cfg = new Configuration();
cfg.setProperties(System.getProperties());
SessionFactory sessions = cfg.configure().buildSessionFactory();
I have taken a look at the Configuration class and saw that the properties set by the configure call are being overridden by the call to setProperties. Assuming this is why it failed, i should be able to safely take out the call to setProperties on the Configuration object from the code.
Code:
Configuration cfg = new Configuration();
SessionFactory sessions = cfg.configure().buildSessionFactory();
Thanks for all the help. Wasted half a day on this :)