1 Reply Latest reply: Jun 7, 2011 1:37 AM by Opal RSS

    Lookup failed for 'java:hibernate'

    user9078101
      Hi,

      i'm trying to setup a small application using hibernate, 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 ?

      Following the exception stack:
      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