liquibase + derby= Error closing derby cleanly

For derby, liquibase attempts to close the database cleanly, but depending on how it is opened it sometimes doesn’t work. I don’t use derby enough to know all the logic behind how closing is supposed to be.


If your database is not complaining about not being closed properly, I think you can safely ignore it.


Nathan

Hi guys,

I’m using apache derby 10.8.1.2 and liquibase 2.0.1

I created a database using derby’s ij tool:

ij> CONNECT ‘jdbc:derby:exampledb;create=true’;


which I’d like to use with liquibase. So far so good.

So I copied the derby.jar and the deryclient.jar to the liquibase folder and set them in the classpath while running liquibase:

java -jar liquibase.jar --classpath=derby.jar:derbyclient.jar --driver=org.apache.derby.jdbc.EmbeddedDriver --changeLogFile=db-changelog.xml --url=“jdbc:derby:exampledb” migrate

I use the example changelog.xml that is described over here: http://www.liquibase.org/quickstart

What I get to read when executing the above command is this:

$ java -jar liquibase.jar --classpath=derby.jar:derbyclient.jar --driver=org.apache.derby.jdbc.EmbeddedDriver --changeLogFile=db-changelog.xml --url=“jdbc:derby:exampledb” migrate
INFO 08/06/11 23:53:liquibase: Successfully acquired change log lock
INFO 08/06/11 23:53:liquibase: Reading from DATABASECHANGELOG
INFO 08/06/11 23:53:liquibase: Reading from DATABASECHANGELOG
INFO 08/06/11 23:53:liquibase: Successfully released change log lock
INFO 08/06/11 23:53:liquibase: Shutting down derby connection: jdbc:derby:exampledb;shutdown=true
SEVERE 08/06/11 23:53:liquibase: Error closing derby cleanly
java.lang.ClassNotFoundException: org.apache.derby.jdbc.EmbeddedDriver
    at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:186)
    at liquibase.database.core.DerbyDatabase.close(DerbyDatabase.java:118)
    at liquibase.integration.commandline.Main.doMigration(Main.java:741)
    at liquibase.integration.commandline.Main.main(Main.java:116)
Liquibase Update Successful


As you can see is that liquibase claims the update was successfully done, which seems to be right when having a look into derby afterwards:

ij> SELECT * FROM department;
ID         |NAME                                              |ACTIVE
---------------------------------------------------------------------

0 rows selected


So the question is: is there need to worry at all?

These to log messages do bug me a bit:

SEVERE 08/06/11 23:53:liquibase: Error closing derby cleanly
java.lang.ClassNotFoundException: org.apache.derby.jdbc.EmbeddedDriver

The EmbeddedDriver class is existent in the derby.jar under the correct path, btw.

Thanks for any comments.

All right, thanks for your quick answer.

I don’t use derby too often as well, and it seems that sqlite is so much easier and convenient to use that I will stick with that.

Will update the wiki the next days.

BTW: Are you fine with the changes I made yesterday?


Greetings
hennr