You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DerbyDatabase.close() is throwing a java.lang.ClassNotFoundException: liquibase.repackaged.org.apache.derby.jdbc.EmbeddedDriver.
This is because DerbyDatabase.getDefaultDriver() returns the liquibase.repackaged... driver class name rather than the actual one.
It seems that the source code and the binary do not correspond to each other for 4.6.x.
The getDefaultDriver for Derby no longer fails with an error due to a mismatch in expected class name.
Test Notes
If you run mvn clean test and get an error that --release is an invalid flag, check your $JAVA_HOME variable; you need a Java version newer than Java 8 to use the example build.
To run the tests using the fix branch, follow the instructions in Liquibase SDK Maven Plugin to get the artifact associated with the PR 2429. Remember to set the branch name in your .m2 settings.xml to dont-shade-all-apache.
** Error Seen Before Fix**
[INFO] Running com.alexlitovsky.bug.liquibase.derby.DerbyDatabaseTest
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.176 s <<< FAILURE! - in com.alexlitovsky.bug.liquibase.derby.DerbyDatabaseTest
[ERROR] testGetDefaultDriver Time elapsed: 0.172 s <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <org.apache.derby.jdbc.EmbeddedDriver> but was: <liquibase.repackaged.org.apache.derby.jdbc.EmbeddedDriver>
at com.alexlitovsky.bug.liquibase.derby.DerbyDatabaseTest.testGetDefaultDriver(DerbyDatabaseTest.java:16)
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] DerbyDatabaseTest.testGetDefaultDriver:16 expected: <org.apache.derby.jdbc.EmbeddedDriver> but was: <liquibase.repackaged.org.apache.derby.jdbc.EmbeddedDriver>
Environment
openjdk version "11.0.13" 2021-10-19 LTS
OpenJDK Runtime Environment Zulu11.52+13-CA (build 11.0.13+8-LTS)
OpenJDK 64-Bit Server VM Zulu11.52+13-CA (build 11.0.13+8-LTS, mixed mode)
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Liquibase Version: 4.6.x
Liquibase Integration & Version: maven
Liquibase Extension(s) & Version:
Database Vendor & Version: Derby 10.14.2.0
Operating System Type & Version: MacOS Monterey
Description
DerbyDatabase.close()
is throwing ajava.lang.ClassNotFoundException: liquibase.repackaged.org.apache.derby.jdbc.EmbeddedDriver
.This is because
DerbyDatabase.getDefaultDriver()
returns theliquibase.repackaged...
driver class name rather than the actual one.It seems that the source code and the binary do not correspond to each other for 4.6.x.
Steps To Reproduce
Actual Behavior
Test fails:
expected: <org.apache.derby.jdbc.EmbeddedDriver> but was: <liquibase.repackaged.org.apache.derby.jdbc.EmbeddedDriver>
Expected/Desired Behavior
The test should pass.
The text was updated successfully, but these errors were encountered: