1 Reply Latest reply on Jan 10, 2008 1:18 PM by goodidea

    hibernate SessionFactory lookup return null

    goodidea

      My hibernate-service.xml

      <server>
      <mbean code="org.jboss.hibernate.jmx.Hibernate" name="jboss.har:service=Hibernate">
      <depends>jboss:service=Naming</depends>
      <depends>jboss:service=TransactionManager</depends>
      <attribute name="DatasourceName">java:/reqDS</attribute>
      <attribute name="Dialect">org.hibernate.dialect.MySQL5InnoDBDialect</attribute>
      <attribute name="ShowSqlEnabled">true</attribute>
      <attribute name="SessionFactoryName">hibernate/SessionFactory</attribute>
      </mbean>
      </server>
      

      req.har successfully loaded.
      In my swing client I am trying to lookup "SessionFactory"
      InitialContext ctx=new InitialContext();
      Object obj=ctx.lookup("java:/hibernate/SessionFactory");
      

      obj is ALWAYS NULL. Help please.
      Release ID: JBoss [Trinity] 4.2.1.GA,
      Hibernate-Version: 3.2.4.sp1

      ctx.list("") return all my jndi Objects properly, and hibernate also in that list.

        • 1. Re: hibernate SessionFactory lookup return null
          goodidea

          One very important addition.


          On serverside

          InitialContext ctx=new InitialContext();
          Object obj=ctx.lookup("java:/hibernate/SessionFactory");

          this code works fine!
          Issue on client side when I am trying to use it from my swing application.
          So in order to be more precise client side can not use SessionFactory. However rest of jndi Objects are fine.