Announcement Announcement Module
Collapse
No announcement yet.
Trying to connect to Oracle 8i,Exception in Spring Framwork Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Trying to connect to Oracle 8i,Exception in Spring Framwork

    Hi,

    I am new to Spring Framework and I am using Spring Framework with hibernate and Oracle 8.1.5. I am trying to run a simple test Project and I am getting the following exception:

    [junit] Caused by: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'sessionFactory' defined in file [C:\ToniProj\build\dao\classes\META-INF\applicationContext-hibernate.xml]: Initialization of bean failed; nested exception is java.lang.AbstractMethodError: oracle.jdbc.driver.OracleDatabaseMetaData.supports ResultSetType(I)Z

    Anybody has any idea about this problem.

    Please let me know.

    Rgrds.

  • #2
    Normally, an AbstractMethodError usually points to the fact that code is trying to call an abstract method. In general this means that service code was changed and the calling has not been recompiled to change with it.

    Can you post the full stack trace so we can exactly where the error occurs?

    Rob

    Comment


    • #3
      Trying to connect to Oracle 8i,Exception in Spring Framwork

      Hi Robh,

      The full stack trace is the following:


      [echo] Testing dao...
      [junit] Testsuite: com.rajj.dao.GenericDAOTest
      [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
      [junit] Null Test: Caused an ERROR
      [junit] null
      [junit] java.lang.ExceptionInInitializerError
      [junit] at java.lang.Class.forName0(Native Method)
      [junit] at java.lang.Class.forName(Unknown Source)
      [junit] Caused by: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'sessionFactory' defined in file [C:\ToniProj\build\dao\gen\META-INF\applicationContext-hibernate.xml]: Initialization of bean failed; nested exception is java.lang.AbstractMethodError: oracle.jdbc.driver.OracleDatabaseMetaData.supports ResultSetType(I)Z
      [junit] at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:361)
      [junit] at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:223)
      [junit] at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:147)
      [junit] at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:271)
      [junit] at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:312)
      [junit] at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:80)
      [junit] at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:65)
      [junit] at com.rajj.dao.BaseDAOTestCase.<clinit>(BaseDAOTestC ase.java:34)
      [junit] ... 5 more
      [junit] Caused by: java.lang.AbstractMethodError: oracle.jdbc.driver.OracleDatabaseMetaData.supports ResultSetType(I)Z
      [junit] at org.hibernate.cfg.SettingsFactory.buildSettings(Se ttingsFactory.java:80)
      [junit] at org.hibernate.cfg.Configuration.buildSettings(Conf iguration.java:1463)
      [junit] at org.hibernate.cfg.Configuration.buildSessionFactor y(Configuration.java:1004)
      [junit] at org.springframework.orm.hibernate3.LocalSessionFac toryBean.newSessionFactory(LocalSessionFactoryBean .java:746)
      [junit] at org.springframework.orm.hibernate3.LocalSessionFac toryBean.afterPropertiesSet(LocalSessionFactoryBea n.java:673)
      [junit] at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:962)
      [junit] at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:354)
      [junit] ... 12 more

      Comment


      • #4
        Can you post your Hibernate configuration as well?

        Rob

        Comment


        • #5
          Hi,

          The following are in applicationContext-hibernate.xml:



          <?xml version="1.0" encoding="UTF-8"?>
          <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
          "http://www.springframework.org/dtd/spring-beans.dtd">

          <beans>
          <!-- Hibernate SessionFactory -->
          <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSes sionFactoryBean">
          <property name="dataSource"><ref bean="dataSource"/></property>
          <property name="mappingResources">
          <list>
          <value>com/rajj/model/Role.hbm.xml</value>
          <value>com/rajj/model/User.hbm.xml</value>
          <value>com/rajj/model/UserCookie.hbm.xml</value>
          </list>
          </property>
          <property name="hibernateProperties">
          <props>
          <prop key="hibernate.dialect">org.hibernate.dialect.Orac leDialect</prop>
          <!-- Create/update the database tables automatically when the JVM starts up
          <prop key="hibernate.hbm2ddl.auto">update</prop> -->
          <!-- Turn batching off for better error messages under PostgreSQL
          <prop key="hibernate.jdbc.batch_size">0</prop> -->
          </props>
          </property>
          </bean>

          <!-- Transaction manager for a single Hibernate SessionFactory (alternative to JTA) -->
          <bean id="transactionManager" class="org.springframework.orm.hibernate3.Hibernat eTransactionManager">
          <property name="sessionFactory"><ref local="sessionFactory"/></property>
          </bean>

          <!-- Generic DAO - can be used when doing standard CRUD -->
          <bean id="dao" class="com.rajj.dao.hibernate.BaseDAOHibernate">
          <property name="sessionFactory"><ref local="sessionFactory"/></property>
          </bean>

          <!-- LookupDAO: Hibernate implementation -->
          <bean id="lookupDAO" class="com.rajj.dao.hibernate.LookupDAOHibernate">
          <property name="sessionFactory"><ref local="sessionFactory"/></property>
          </bean>

          <!-- UserDAO: Hibernate implementation -->
          <bean id="userDAO" class="com.rajj.dao.hibernate.UserDAOHibernate">
          <property name="sessionFactory"><ref local="sessionFactory"/></property>
          </bean>

          <!-- RoleDAO: Hibernate implementation -->
          <bean id="roleDAO" class="com.rajj.dao.hibernate.RoleDAOHibernate">
          <property name="sessionFactory"><ref local="sessionFactory"/></property>
          </bean>

          <!-- Add new DAOs here -->

          </beans>

          Comment


          • #6
            Nothing looks out of order with your configuration. The stack trace shows that this error being generated by some Hibernate code SettingsFactory.buildSettings when it attempts to call an abstract method on the OracleDatabaseMetaData class. This could either be a problem with Hibernate or a problem with the Oracle driver. Check both of the corresponding web sites to see if this is a known issue.

            Rob

            Comment

            Working...
            X