Hi folks,
I noticed this question has been asked a couple of times, at least once in the Tools forum. Unfortunately none seems to fix my problem.
I am new to the whole Hibernate/Eclipse thing and decided to give it a try with Hibernate Tools. It's generated everything and I was trying to do a simple test by persisting a single object in the main() method:
Code:
Dog dog = new Dog();
dog.setName("Bob");
DogHome dogHome = new DogHome();
dogHome.persist(dog);
Unfortunately it failed in DogHome.getSessionFactory() method, on the line that says
Code:
return (SessionFactory) new InitialContext().lookup("SessionFactory");
I'm relying on the tools too much at the moment to realise what is exactly going on under the bonnet (or hood...). Any suggestions or even pointers would be greatly appreciated.
Thanks,
Dany.