4 Replies Latest reply on Aug 21, 2007 1:21 PM by boga chandrakanth

    JNDI classCastException

    boga chandrakanth Newbie

      When i start the JBOSS server , i am getting the following error:--

      ------------------------------------------------------------------------------------

      [DatasourceConnectionProvider] Using datasource: java:/JDBC/MIB
      07:43:21,140 INFO [TransactionFactoryFactory] Transaction strategy: net.sf.hibernate.transaction.JTATransactionFactory
      07:43:21,250 INFO [NamingHelper] JNDI InitialContext properties:{}
      07:43:21,265 INFO [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: net.sf.hibernate.transactio
      n.JBossTransactionManagerLookup
      07:43:21,265 INFO [TransactionManagerLookupFactory] instantiated TransactionManagerLookup
      07:43:21,265 INFO [NamingHelper] JNDI InitialContext properties:{}
      07:43:21,281 INFO [STDOUT] [HR] Exception caught while calling l_hibCfg.buildSessionFactory()
      07:43:21,296 INFO [STDOUT] java.lang.ClassCastException
      07:43:21,296 INFO [STDOUT] at net.sf.hibernate.transaction.JNDITransactionManagerLookup.getTransactionManager(JNDIT
      ransactionManagerLookup.java:23)
      07:43:21,296 INFO [STDOUT] at net.sf.hibernate.transaction.JTATransactionFactory.configure(JTATransactionFactory.ja
      va:48)
      07:43:21,312 INFO [STDOUT] at net.sf.hibernate.transaction.TransactionFactoryFactory.buildTransactionFactory(Transa
      ctionFactoryFactory.java:48)
      07:43:21,312 INFO [STDOUT] at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:77)
      07:43:21,312 INFO [STDOUT] at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1172)
      07:43:21,328 INFO [STDOUT] at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:803)
      07:43:21,328 INFO [STDOUT] at com.jnc.hibernate.HibernateRegistry.registerFactory(HibernateRegistry.java:225)
      07:43:21,343 INFO [STDOUT] at com.jnc.hibernate.HibernateRegistry.initializeRegistry(HibernateRegistry.java:80)
      07:43:21,343 INFO [STDOUT] at com.jnc.hibernate.HibernateRegistry.(HibernateRegistry.java:41)
      07:43:21,343 INFO [STDOUT] at com.jnc.novell.director.impl.HibernateRegistryManager.resourceSetAvailable(HibernateR
      egistryManager.java:110)
      07:43:21,343 INFO [STDOUT] at com.jnc.novell.director.impl.HibernateResourceListener$BootStaller.run(HibernateResou
      rceListener.java:93)
      07:43:21,359 INFO [STDOUT] [HR] path /hibernate/OSTModel.cfg.xml


      ------------------------------------------------------------------------------------


      Could any one please tell me what could be the probem.
      I am new to the jboss forums.
      If any one feels that the problem is not related to this topic then pls suggest me.

        • 1. Re: JNDI classCastException
          jaikiran pai Master

           

          Exception caught while calling l_hibCfg.buildSessionFactory()
          07:43:21,296 INFO [STDOUT] java.lang.ClassCastException
          07:43:21,296 INFO [STDOUT] at net.sf.hibernate.transaction.JNDITransactionManagerLookup.getTransactionManager


          Can you post the contents of your hibernate.properties or hibernate.cfg.xml file?


          • 2. Re: JNDI classCastException
            boga chandrakanth Newbie

            <!--
            *****************************
            * NOTE: PLEASE ALSO CHECK THE HIBERNATE.PROPERTIES FILE
            FOR SYSTEM LEVEL CONFIGURATION PROPERTIES *

            ***************************** -->
            <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
            "http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd" > <hibernate-configuration>
            <session-factory name="ust-model">
            <!-- Database connection and transaction properties -->
            java:/JDBC/MIB
            net.sf.hibernate.transaction.JTATransac
            tionFactory



            net.sf.hibernate.transaction.JBossTransactionManagerLookup
            net.sf.hibernate.dialect.Oracle9Dialect

            <!-- Additional configuration properties -->
            false

            <!-- WARNING: This causes great problems with the oracle driver, it doesn't return a valid rowcount must be FALSE with Oracle -->
            false

            <!-- This property allows you to enable HQL query caches, using
            Query.setCacheable(true) and Query.setCacheRegion(name) for ehcache.xml config -->
            true

            <!-- mapping files to be included with this session factory
            -->











            <!-- //~pb: Issue #00368 -->


            </session-factory>
            </hibernate-configuration>




            • 3. Re: JNDI classCastException
              jaikiran pai Master

              Which version of JBoss are you using? Also, have you packaged and jboss related jars (especially the jta related jars) in your application? Can you also post the some logs, that you see before the exception is thrown?

              • 4. Re: JNDI classCastException
                boga chandrakanth Newbie

                i resolved issue by deleting the hibernate.jar file from jboss.

                thanks for the support