In my project[1] I am using a derby in-memory database with the embedded
driver for unit testing and integration testing.  I am using PostgreSQL
as the production server.

I am using Liquibase[2] to set up the schema for both Derby and
PostgreSQL, and I'm also using Liquibase to set up the test data in the
derby database.

What I wanted to do, was to dump the test database to a Derby network
server and do some tests on the data.  My changes worked fine in
PostgreSQL but not in the derby tests, and I wanted the chance to take a
look at them.

So what I did was add a pseudo unit test to a test class, that would
connect to "jdbc:derby://localhost:1527/ukelonn"[3].

When I tried running that test, it was unable to find the driver.

So I googled a bit more, and added a dependency to the derby client
jar in the test scope[4].

But then the unit test failed with the following error:
 java.lang.ClassCastException: org.apache.derby.jdbc.ClientDriver cannot be 
cast to org.apache.derby.jdbc.InternalDriver
        at org.apache.derby.jdbc.BasicEmbeddedDataSource40.findDriver(Unknown 

Are the problems caused by me having both the embedded driver and the
network driver loaded into the same java application (in this case: the
same JUnit test)?

If there is a conflict between the embedded JDBC driver and the client
JDBC driver, is there a way around the conflict, other than creating a
separate maven project just to upload the liquibase files?


- Steinar

 [1] <>
 [2] <>

Reply via email to