0 Replies Latest reply on Dec 19, 2005 4:13 AM by brianinchrist

    Hibernate 3 JNDI-bound

    brianinchrist

      Help!!!
      There is a sample on docs site of hibernate.
      http://www.hibernate.org/hib_docs/v3/reference/en/html/session-configuration.html#configuration-optional-jndi

      I did the sample step by step, but failed.
      The warning as following:

      INFO [SettingsFactory] Deleted entity synthetic identifier rollback: disabled
      INFO [SettingsFactory] Default entity-mode: POJO
      INFO [SessionFactoryImpl] building session factory
      INFO [SessionFactoryObjectFactory] Factory name: TestSessionFactory
      INFO [NamingHelper] JNDI InitialContext properties:{}
      INFO [SessionFactoryObjectFactory] Bound factory to JNDI name: TestSessionFactory
      WARN [SessionFactoryObjectFactory] InitialContext did not implement EventContext


      I made a hbn.sar including :
      jboss-service.xml
      A.hbm.xml
      A.class

      jboss-service.xml as following:
      <server>
      <mbean code="org.hibernate.jmx.HibernateService"
       name="jboss.jca:service=HibernateFactory,name=HibernateFactory">
       <depends>jboss.jca:service=RARDeployer</depends>
       <depends>jboss.jca:service=LocalTxCM,name=MySqlDS</depends>
       <attribute name="JndiName">TestSessionFactory</attribute>
       <attribute name="Datasource">java:MySqlDS</attribute>
       <attribute name="Dialect">org.hibernate.dialect.MySQLDialect</attribute>
       <attribute name="TransactionStrategy">
       org.hibernate.transaction.JTATransactionFactory</attribute>
       <attribute name="TransactionManagerLookupStrategy">
       org.hibernate.transaction.JBossTransactionManagerLookup</attribute>
       <attribute name="FlushBeforeCompletionEnabled">true</attribute>
       <attribute name="AutoCloseSessionEnabled">true</attribute>
       <attribute name="MaximumFetchDepth">5</attribute>
       <attribute name="SecondLevelCacheEnabled">false</attribute>
       <attribute name="CacheProviderClass">org.hibernate.cache.EhCacheProvider</attribute>
       <attribute name="QueryCacheEnabled">false</attribute>
       <attribute name="ShowSqlEnabled">false</attribute>
       <attribute name="MapResources">A.hbm.xml</attribute>
      </mbean>
      </server>


      I'm not sure what happened in server. What should I add on? Please help. Thank you.