Describe the bug
When upgrading brotli4j from 1.12.0 to 1.13.0 (and onwards) in a Java modular application the following error was reported:
Error reading module: /home/jkuhn/.m2/repository/com/aayushatharva/brotli4j/native-linux-x86_64/1.15.0/native-linux-x86_64-1.15.0.jar'
java.lang.module.InvalidModuleDescriptorException: Package com.aayushatharva.brotli4j.linux.ppc64le not found in module'.
I've compared META-INF/versions/9/module-info.class files:
for native-linux-x86_64-1.12.0.jar:
module com.aayushatharva.brotli4j.linux.x86_64 {
requires com.aayushatharva.brotli4j.service;
requires java.base;
exports com.aayushatharva.brotli4j.linux.x86_64 to com.aayushatharva.brotli4j;
provides com.aayushatharva.brotli4j.service.BrotliNativeProvider with com.aayushatharva.brotli4j.linux.x86_64.NativeLoader;
}
from native-linux-x86_64-1.13.0.jar:
module com.aayushatharva.brotli4j.linux.ppc64le {
requires com.aayushatharva.brotli4j.service;
requires java.base;
exports com.aayushatharva.brotli4j.linux.ppc64le to com.aayushatharva.brotli4j;
provides com.aayushatharva.brotli4j.service.BrotliNativeProvider with com.aayushatharva.brotli4j.linux.ppc64le.NativeLoader;
}
So it seems from 1.13.0, x86_64 jar contains module descriptor for ppc64le and since the exported ppc64le package does not exist in the Jar the module is corrupted and can't be loaded. I haven't checked for other architectures but maybe they are also impacted.
To Reproduce
Create a Java modular application on linux x86_64 platform which uses brotli modules.
Expected behavior
native-linux-x86_64-1.15.0.jar must contain module com.aayushatharva.brotli4j.linux.x86_64.
ModuleFinder can load module com.aayushatharva.brotli4j.linux.x86_64 from native-linux-x86_64-1.15.0.jar
Logs
If applicable, add logs to help explain your problem.
Platform (please complete the following information):
- Device: Linux
- OS: Debian GNU/Linux 11 (bullseye) Linux 5.10.0-27-amd64
- Java Version:
openjdk version "21.0.1" 2023-10-17
OpenJDK Runtime Environment (build 21.0.1+12-29)
OpenJDK 64-Bit Server VM (build 21.0.1+12-29, mixed mode, sharing)
Additional context
Add any other context about the problem here.
Describe the bug
When upgrading brotli4j from 1.12.0 to 1.13.0 (and onwards) in a Java modular application the following error was reported:
I've compared
META-INF/versions/9/module-info.classfiles:for native-linux-x86_64-1.12.0.jar:
from native-linux-x86_64-1.13.0.jar:
So it seems from 1.13.0, x86_64 jar contains module descriptor for ppc64le and since the exported ppc64le package does not exist in the Jar the module is corrupted and can't be loaded. I haven't checked for other architectures but maybe they are also impacted.
To Reproduce
Create a Java modular application on linux x86_64 platform which uses brotli modules.
Expected behavior
native-linux-x86_64-1.15.0.jar must contain module
com.aayushatharva.brotli4j.linux.x86_64.ModuleFindercan load modulecom.aayushatharva.brotli4j.linux.x86_64from native-linux-x86_64-1.15.0.jarLogs
If applicable, add logs to help explain your problem.
Platform (please complete the following information):
openjdk version "21.0.1" 2023-10-17
OpenJDK Runtime Environment (build 21.0.1+12-29)
OpenJDK 64-Bit Server VM (build 21.0.1+12-29, mixed mode, sharing)
Additional context
Add any other context about the problem here.