Liquibase 2.0.1 and Oracle DB - I can't get it to work

I have been using liquibase to update my database for a few months now and ran into some issues on a different machine using liquibase.  I decided to try upgrading to the latest and greatest liquibase version to see if I could bypass the issue and now I am getting errors on my current setup.

Here is the stack trace

build.xml:657: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: java.sql.SQLException: Unsupported feature
at liquibase.database.AbstractDatabase.getDatabaseMajorVersion(AbstractDatabase.java:145)
at liquibase.Liquibase.setDatabasePropertiesAsChangelogParameters(Liquibase.java:720)
at liquibase.Liquibase.setDatabase(Liquibase.java:78)
at liquibase.Liquibase.(Liquibase.java:63)
at liquibase.integration.ant.BaseLiquibaseTask.createLiquibase(BaseLiquibaseTask.java:181)
at liquibase.integration.ant.DatabaseUpdateTask.execute(DatabaseUpdateTask.java:33)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397)
at org.apache.tools.ant.Project.executeTarget(Project.java:1366)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1249)
at org.apache.tools.ant.Main.runBuild(Main.java:801)
at org.apache.tools.ant.Main.startAnt(Main.java:218)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: liquibase.exception.DatabaseException: java.sql.SQLException: Unsupported feature
at liquibase.database.jvm.JdbcConnection.getDatabaseMajorVersion(JdbcConnection.java:43)
at liquibase.database.AbstractDatabase.getDatabaseMajorVersion(AbstractDatabase.java:143)
… 21 more
Caused by: java.sql.SQLException: Unsupported feature
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
at oracle.jdbc.dbaccess.DBError.throwUnsupportedFeatureSqlException(DBError.java:690)
at oracle.jdbc.OracleDatabaseMetaData.getDatabaseMajorVersion(OracleDatabaseMetaData.java:4451)
at liquibase.database.jvm.JdbcConnection.getDatabaseMajorVersion(JdbcConnection.java:41)
… 22 more

I thought that maybe it was my oracle database driver but I continue to get the error even after updating my driver files to be 11g drivers.    My actual database is 10g, does liquibase 2.0.1 require an 11g database?  Any insights into the problem would help.

Thanks.

It is failing on this line: connection.getMetaData().getDatabaseMajorVersion() which appears to be a jdbc driver issue.  Liquibase runs fine with the 10g driver.  Are you sure there isn’t a 9i or earlier driver somewhere in your classpath?

Nathan

Here is my ant code.

 
     
     
      <updateDatabase
            changeLogFile="${liquibase.changelog.file}"
            driver="${liquibase.dbdriver}"
            url="${sqlj.url}"
            username="${sqlj.user}"
            password="${sqlj.password}"
            promptOnNonLocalDatabase=“true”
            dropFirst=“false”
            contexts="${liquibase.context}"
            classpathref=“liquibase.classpath”
      />

 

Here is what I think is happening.  In my project there are two ojdbc jars.  One is a 10g jar I use for my java application the other is a 11g jar that we added specifically for liquibase.  I am passing in a classpathref to the command that includes only liquibase.jar and the 11g oracle driver jar.

What I have found though is my console environment has a CLASSPATH variable set that has the 10g driver in it.  Somehow the updateDatabase command is using both the classpathref I passed in and my environment classpath variable.    If I do “unset CLASSPATH” then running “ant updatedb” works without the error.

One other note, I am currently running 2.0-rc7 as my liquibase version and it does not have the problem I am seeing in 2.0.1 .     I have noticed one other new problem.   With the new jar when I run ant it tries to start up some sort of AWT process.    When I try and run it on an environment without a GUI it fails saying it needs a GUI in order to run.

updatedb:
    [echo] liquibase.jar:ojdbc5.jar
2011-02-01 14:01:00.612 java[80092:60f] Apple AWT Startup Exception : *** -[NSCFString appendString:]: nil argument
2011-02-01 14:01:00.614 java[80092:60f] Apple AWT Restarting Native Event Thread

any thoughts?

The promptOnNonLocalDatabase=“true” makes liquibase create a UI prompt if you are connecting to a database other than localhost.  In your case, you will need that to false if you are getting an error.

Nathan