4 Replies Latest reply on May 14, 2003 9:43 AM by Bill Pfeiffer

    Hibernate 2.0 jndi datasource lookup fails

    Bill Pfeiffer Newbie

      I'm attempting to set up Hibernate 2.0 jmx service to work with JBoss 3.2.1. The service (deployed SAR) fails when it attempts to obtain ds connection via jndi. I have it configured to use the same jndi name my j2ee app uses (successfully!).

      The hibernate code appears to be doing the same thing my j2ee code is doing: gets the default InitialContext and does the lookup.

      Here's a snip of the error:

      2003-05-07 21:41:34,183 INFO [net.sf.hibernate.util.NamingHelper] JNDI InitialContext properties:{}
      2003-05-07 21:56:10,684 FATAL [net.sf.hibernate.connection.DatasourceConnectionProvider] Could not find datasource: java:comp/env/espeed
      javax.naming.NameNotFoundException: env not bound
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
      at org.jnp.server.NamingServer.getObject(NamingServer.java:509)
      at org.jnp.server.NamingServer.lookup(NamingServer.java:253)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:492)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:606)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:471)
      at javax.naming.InitialContext.lookup(InitialContext.java:347)
      at net.sf.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:44)