New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exploded archives launched using the launcher have an incorrectly ordered classpath that also contains non-existent jar files #24192
Comments
Thanks for the report. I've reproduced the problem. |
The underlying problem exists in Boot 2.3.x. The warning messages only appear with Boot 2.4 due to some changes in Flyway 7. With Spring Boot 2.3 and 2.4, the
The The unwanted entries are contributed by the class path index. It has a contains entry check that is intended to prevent this duplication. It isn't working at the moment as the index's entries are just the jar's name (for example Manually editing the index file to prepend each entry with |
Skipping unloadable jar
on layered container image
When building with Maven at least, things worked fine up to and including Boot 2.3.0.M3 where the index had contents similar to the following:
In 2.3.0.M4, the contents then changed and lost the
At this point, the classpath contains two entries for each jar, one that exists and one that does not and the entries for existing jars are not in the correct order. |
@wilkinsona Yes I agree with your analysis. Since ad16426 also introduced a bug that jars are not loaded in a consistent order, should we create a separate issue (that can be closed by the same commit) for that so that it appears in the release notes? |
Thanks, @mbhave. I've retitled this issue to hopefully capture both parts of the problem. |
I have a boot application which is executing flyway migrations on app start. The migration itself runs succesfully.
But when create a docker image with
mvn spring-boot:build-image
and run the image its show many warnings in the log:Skipping unloadable jar file: file:/workspace/XXXjar
Im also try to create a custom image following the instruction here https://spring.io/blog/2020/08/14/creating-efficient-docker-images-with-spring-boot-2-3.
I have placed the app code in the folder /opt/app inside of the container. Here im also getting this warnings:
Skipping unloadable jar file: file:/opt/app/XXX.jar (/opt/app/XXX.jar)
Here i found out that the scanner try to upen the jar in the wrong folder.
Its not placed in /opt/app its inside of /opt/app/BOOT-INF/lib/XXXjar.
With fat jar images its working without warnings.
The migration script are placed in the deafult folder
classpath:db/migrations
Spring Boot Version: 2.4.0
The text was updated successfully, but these errors were encountered: