Java 5 Compatibility?

Liquibase works great with Java 5, however, I noted some problems when SQLException is thrown. I am using Liquibase 2.0.

Liquibase uses constructors for SQLException, e.g. SQLException(Throwable cause), which are compatible with Java 6, but not Java 5. When I run liquibase on Java 5, I get the following error message instead of the actual error:

java.sql.SQLException: method (Ljava/lang/String;Ljava/lang/Throwable;)V not found:

This makes it quite difficult to trace errors as the actual SQL error is swallowed by the method not found error.  :-\

I’m not seeing where we are using a String,Throwable constructor.  Can you post the full stacktrace you are seeing?

Are you using the RC release of liquibase, or the latest version from the build server or built from trunk?


Shoots! I should have posted the full stack-trace. I currently have the database problems fixed, so I do not get any of the errors. Let me post a stack trace once I come across one…

…so it turns out it was my fault after all. When I updated my Eclipse installation a while ago, I forgot to set the default JDK setting to JDK 5. So, when I was coding, I was unknowingly coding against Java 6 where everything looked fine. However, when I run my code under Java 5, I got errors from exceptions that I was calling that were only available in Java 6…

What a rookie mistake. My apologies.

Thanks for the update, glad you figured it out.