liquibase: Liquibase 4.0 problem when starting with jar
Environment
Liquibase Version: 4.0
Liquibase Integration & Version: Spring Boot 2.3
Liquibase Extension(s) & Version: N/A
Database Vendor & Version: PostgreSQL 11
Operating System Type & Version: Windows 10
Description
An issue was reported in JHipster’s project page that my own team is encountering as well: starting up a Spring Boot fat jar that contains Liquibase fails to conduct the database schema migrations due to an issue with there not being a file system available for the Spring Boot jar.
Steps To Reproduce
- Create a Spring Boot fat jar that cointains Liquibase version 4.0.0.
- Launch the Spring Boot application by running
java -jar /path/to/springBootApp.jar
Actual Behavior
Liquibase fails to start due to a series of errors like the one below:
java.nio.file.FileSystemNotFoundException: null
at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.getFileSystem(ZipFileSystemProvider.java:169)
at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.getPath(ZipFileSystemProvider.java:155)
at java.base/java.nio.file.Path.of(Path.java:208)
at java.base/java.nio.file.Paths.get(Paths.java:97)
at liquibase.resource.ClassLoaderResourceAccessor.loadRootPaths(ClassLoaderResourceAccessor.java:63)
Liquibase will encounter this error for each of the files within the fat jar, e.g.
- “jar:file:/C:/path/to/foo.jar!/BOOT-INF/classes!/”
- “jar:file:/C:/path/to/foo.jar!/BOOT-INF/lib/foo-api.jar!/”
- “jar:file:/C:/path/to/foo.jar!/BOOT-INF/lib/foo-domain.jar!/”
Expected/Desired Behavior
Liquibase can start up normally.
Additional Context
This looks like a relevant posting from StackExchange regarding what may be the underlying cause.
┆Issue is synchronized with this Jira Bug by Unito ┆fixVersions: Liquibase 4.1.1
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 18
- Comments: 28 (7 by maintainers)
Commits related to this issue
- use liquibase 3.10.2 https://github.com/liquibase/liquibase/issues/1276 — committed to ls1intum/Artemis by deleted user 4 years ago
- Downgrade liquibase core from 4.0.0 to 3.10.2 due to bug https://github.com/liquibase/liquibase/issues/1276 — committed to informatique-cdc/ebad by dtrouillet 4 years ago
- AM-1043: Downgrading the liquibase version to 3.10.2 to fix the issue https://github.com/liquibase/liquibase/issues/1276 — committed to hmcts/am-role-assignment-service by nitishsingla1234 4 years ago
- AM-1043: Upgrading the liquibase version to 4.1.0 to fix the issue https://github.com/liquibase/liquibase/issues/1276 — committed to hmcts/am-role-assignment-service by nitishsingla1234 4 years ago
- AM-1043: Downgrafing the liquibase version to 3.10.2 to fix the issue https://github.com/liquibase/liquibase/issues/1276 — committed to hmcts/am-role-assignment-service by nitishsingla1234 4 years ago
- Am 1040 master (#396) * Added the README.md file * updated the README.md file and minor chnages in docker-compose file * updated the README.md file and minor chnages in docker-compose file *... — committed to hmcts/am-role-assignment-service by vijayrajagopalan-hmcts 4 years ago
We would appreciate if this bug could be fixed asap! Let us know if we can somehow help
Still reproduces on 4.1.0 version
Just tried 4.1.1. It works, but now it writes the issue description to stdout as a warning.
macOS Catalina
Hi, @RainerGanss ! See my edited comment above to resolve the issue.
➤ Robert Reeves commented:
From Alexandru Slobodcicov:
{quote}Doesn’t look to be fixed, it does the migrations however a lot of exceptions in the logs.
java.nio.file.FileSystemNotFoundException at com.sun.nio.zipfs.ZipFileSystemProvider.getFileSystem(ZipFileSystemProvider.java:171) at com.sun.nio.zipfs.ZipFileSystemProvider.getPath(ZipFileSystemProvider.java:157)
Please have a look at the quickstart application where you can easily test both: 3.10.2 and 4.1.1 the default one.
https://github.com/alexandru-slobodcicov/liquibase-nosql-quickstart ( https://github.com/alexandru-slobodcicov/liquibase-nosql-quickstart|smart-link ) {quote}
➤ Erzsebet Carmean commented:
Liquibase 4.1.1-SNAPSHOTValidated bug repro using 4.1.0 with an XML changelog.Verify there are no file system not found errors during app startup. PASS
Everything looks good here, Nathan.
Hi @severn-everett Thanks for writing up this issue. We will add this to the list of issues that we are reviewing.
Thanks, we’ll have to take a look.