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
Wrong entry may be loaded from multi-release jar files resulting in a NoClassDefFoundError #15981
Comments
I patched org.springframework.boot.loader.jar.JarFileEntries to print out entries and their indexes as they are loaded. For the infinispan-commons-9.4.7.jar I got the following:
However that class file is present only once in the jar. It seems like it is misinterpreting the central directory index: the second entry is actually FastCopyHashMap$Values, which ultimately makes the ClassLoader.defineClass checks fail |
There's a bug in the handling of multi-release jar files that means that it doesn't handle a clash in the index generated from an entry's hash correctly. When we're looking for a multi-release entry, the named is aliased so that an entry found beneath |
When we build a simple application using Infinispan 9.4.4.Final or above and Spring-Boot 2.1.x.RELEASE, we package it with
spring-boot:repackage
and then run it usingjava -jar
in Java 11, the application won't start:Reproducer: https://github.com/ben-schroeder/infinispan-ncdfe
Our Issue for further details: https://issues.jboss.org/browse/ISPN-9977
StackOverflow question : https://stackoverflow.com/questions/54635814/why-does-infinispan-fail-with-noclassdeffounderror-on-spring-boot-java-11
The infinispan-commons 9.4.3.Final jar seems to work because this jar is not a multi-release jar (and should be). In any case, Spring Boot 2.1.x and Spring 5 are supported from version 9.4.4.Final.
The text was updated successfully, but these errors were encountered: