Hi,
i'm a novice hibernate developper and trying to setup a small application, but i'm falling while creating the hibernate session factory.
As part of the call to
sessionFactory = new Configuration().configure().buildSessionFactory();, an exception raised related to the java:hibernate lookup.
Who is responsible to create this context ? Why does it not created automatically ?
I'm using glassfish/oracle DB and netbeans IDE.
Following the exception stack:
Code:
WARNING: Could not bind factory to JNDI
javax.naming.NamingException: Lookup failed for 'java:hibernate' in SerialContext [Root exception is javax.naming.NamingException: Invocation exception: Got null ComponentInvocation ]
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:442)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:442)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at org.hibernate.util.NamingHelper.bind(NamingHelper.java:59)
at org.hibernate.util.NamingHelper.bind(NamingHelper.java:59)
at org.hibernate.impl.SessionFactoryObjectFactory.addInstance(SessionFactoryObjectFactory.java:90)
at org.hibernate.impl.SessionFactoryObjectFactory.addInstance(SessionFactoryObjectFactory.java:90)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:306)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:306)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
Thanks for any tips.
Yaakov