Announcement Announcement Module
Collapse
No announcement yet.
could not get database version from JDBC metadata Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • could not get database version from JDBC metadata

    I have a spring + hibernate webapp that works great on websphere 5.1

    Im trying to run the same aplication using Tomcat 4.1.31 + j2sdk 1.4.2_8 and i get this warning:

    2005-07-21 08:43:16,729 WARN [org.hibernate.cfg.SettingsFactory] - could not get database version from JDBC metadata
    java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.hibernate.cfg.SettingsFactory.getDatabaseMajor Version(SettingsFactory.java:289)
    at org.hibernate.cfg.SettingsFactory.buildSettings(Se ttingsFactory.java:76)
    at org.hibernate.cfg.Configuration.buildSettings(Conf iguration.java:1463)
    at org.hibernate.cfg.Configuration.buildSessionFactor y(Configuration.java:1004)
    at org.springframework.orm.hibernate3.LocalSessionFac toryBean.newSessionFactory(LocalSessionFactoryBean .java:769)
    at org.springframework.orm.hibernate3.LocalSessionFac toryBean.afterPropertiesSet(LocalSessionFactoryBea n.java:695)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:966)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:358)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:226)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:147)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:270)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:312)
    at org.springframework.web.context.support.AbstractRe freshableWebApplicationContext.refresh(AbstractRef reshableWebApplicationContext.java:134)
    at org.springframework.web.context.ContextLoader.crea teWebApplicationContext(ContextLoader.java:230)
    at org.springframework.web.context.ContextLoader.init WebApplicationContext(ContextLoader.java:156)
    at org.springframework.web.context.ContextLoaderListe ner.contextInitialized(ContextLoaderListener.java: 48)
    at org.apache.catalina.core.StandardContext.listenerS tart(StandardContext.java:3212)
    at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:3554)
    at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1141)
    at org.apache.catalina.core.StandardHost.start(Standa rdHost.java:707)
    at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1141)
    at org.apache.catalina.core.StandardEngine.start(Stan dardEngine.java:316)
    at org.apache.catalina.core.StandardService.start(Sta ndardService.java:450)
    at org.apache.catalina.core.StandardServer.start(Stan dardServer.java:2143)
    at org.apache.catalina.startup.Catalina.start(Catalin a.java:463)
    at org.apache.catalina.startup.Catalina.execute(Catal ina.java:350)
    at org.apache.catalina.startup.Catalina.process(Catal ina.java:129)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:156)
    Caused by: java.sql.SQLException: Unsupported feature
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java:134)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java:179)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java:269)
    at oracle.jdbc.dbaccess.DBError.throwUnsupportedFeatu reSqlException(DBError.java:690)
    at oracle.jdbc.OracleDatabaseMetaData.getDatabaseMajo rVersion(OracleDatabaseMetaData.java:4028)
    ... 36 more

    I have tried tomcat 5.5 + j2sdk 1.5 and get the same warnig

    After this the webapps works ok ... but its annoying to get this exception everytime i start the server

    the datasource configuration is

    <Resource name="jdbc/cmids" auth="Container" type="javax.sql.DataSource" />
    <ResourceParams name="jdbc/cmids">
    <parameter>
    <name>factory</name>
    <value>org.apache.commons.dbcp.BasicDataSourceFact ory</value>
    </parameter>
    <parameter>
    <name>driverClassName</name>
    <value>oracle.jdbc.driver.OracleDriver</value>
    </parameter>
    <parameter>
    <name>url</name>
    <value>jdbc:oracle:thin:@server:1521:dbst</value>
    </parameter>
    <parameter>
    <name>username</name>
    <value>user</value>
    </parameter>
    <parameter>
    <name>password</name>
    <value>pass</value>
    </parameter>
    <parameter>
    <name>maxActive</name>
    <value>20</value>
    </parameter>
    <parameter>
    <name>maxIdle</name>
    <value>10</value>
    </parameter>
    <parameter>
    <name>maxWait</name>
    <value>-1</value>
    </parameter>
    </ResourceParams>


    The JDBC driver: Oracle JDBC driver, version: 9.2.0.5.0

    Thanks
    Ignacio

  • #2
    The problem is "getDatabaseMajorVersion" - this method does not seem to be supported in the 9i drivers that I just tried. It is however supported in the 10g driver I tried. If you can't upgrade the driver (you can use 10g driver with a 9i db) - try posting on the Hibernate forum. This method call is coming from Hibernate (org.hibernate.cfg.SettingsFactory). This is a method that was added with JDBC 3.0 so it seems a JDBC 3.0 compliant driver is required.

    Comment

    Working...
    X