0 Replies Latest reply on Apr 12, 2006 9:52 AM by vadimv1982

    HibernateFactory not bound!

    vadimv1982

      Need help with Hibernate? Read this first:
      http://www.hibernate.org/ForumMailinglists/HowToAskForHelp

      Hibernate version:3.0.5

      Mapping documents: turundaja-hibernate.sar

      I use Jboss 4.0. and Postresql.

      I have such a problem that i need to run that application under new server and it is workin ok on the old one.
      It seems to deploy ok. But when i try to login into that application i get some problem with security module or smth, may be it is Jaas problem.

      javax.security.auth.login.LoginException: java.lang.ExceptionInInitializerError
      at ee.mobi.congam.DAOFactory.getUserDAO(DAOFactory.java:37)
      at ee.mobi.congam.auth.DBLoginModule.validate(DBLoginModule.java:352)
      at ee.mobi.congam.auth.DBLoginModule.login(DBLoginModule.java:162)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)

      blabla

      Caused by: ee.mobi.congam.ConGamException: Exception initialling DAO: HibernateF
      actory not bound
      at ee.mobi.congam.DAO.(DAO.java:45)
      ... 54 more

      at javax.security.auth.login.LoginContext.invoke(LoginContext.java:872)
      at javax.security.auth.login.LoginContext.access$000(LoginContext.java:1
      86)
      at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)
      at java.security.AccessController.doPrivileged(Native Method)
      at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:6
      80)
      bla bla bla

      So i decided to deploy just one .sar and see what happens and get it while deploying:

      16:21:39,812 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
      MBeans waiting for other MBeans:
      ObjectName: jboss.jca:service=HibernateFactory,name=HibernateFactory
      state: CONFIGURED
      I Depend On: jboss.jca:service=RARDeployer
      jboss.jca:service=LocalTxCM,name=jdbc/psql/turundaja

      Depends On Me:

      MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM:
      ObjectName: jboss.jca:service=LocalTxCM,name=jdbc/psql/turundaja
      state: NOTYETINSTALLED
      I Depend On:
      Depends On Me: jboss.jca:service=HibernateFactory,name=HibernateFactory

      Here is part of postgres-ds.xml:

      <local-tx-datasource>
      <jndi-name>/jdbc/psql/turundaja</jndi-name>
      <connection-url>jdbc:postgresql://localhost:5432/turundaja</connection-url>
      <driver-class>org.postgresql.Driver</driver-class>
      <user-name>turundaja</user-name>

      </local-tx-datasource>

      Here is jboss-service.xml

      <?xml version="1.0"?>




      <!-- Required services -->
      jboss.jca:service=RARDeployer
      jboss.jca:service=LocalTxCM,name=jdbc/psql/turundaja

      <!-- Bind the Hibernate service to JNDI -->
      java:/HibernateFactory

      <!-- Datasource settings -->
      java:/jdbc/psql/turundaja
      org.hibernate.dialect.PostgreSQLDialect

      <!-- Transaction integration -->

      org.hibernate.transaction.JTATransactionFactory

      org.hibernate.transaction.JBossTransactionManagerLookup
      true
      true

      <!-- Fetching options -->
      5

      <!-- Second-level caching -->
      true
      org.hibernate.cache.EhCacheProvider
      true

      <!-- Logging -->
      true

      <!-- Mapping files -->
      ...mappings, xmls....