Created attachment 37716 [details] NetBeans project that exhibits this bug Trying to run a simple Java command line application using the JPMS launcher fails with the following error: Error occurred during initialization of boot layer java.lang.module.FindException: Unable to derive module descriptor for /home/koppdk/.m2/repository/xalan/xalan/2.7.2/xalan-2.7.2.jar Caused by: java.lang.module.InvalidModuleDescriptorException: Provider class org.apache.bsf.BSFManager not in module I have attached a very simple NetBeans maven project that exhibits this error.
Can you provide a bit more details, ideally providing a small project which shows the problem would be good to allow others to easily reproduce it. At least detailed information about what the application tries to do and how you build and run the application are necessary to take a look.
Also exact version of Java might be helpful to narrow down this.
There is a NetBeans project attached to this issue that does what you requested. I ran this against OpenJDK 15, bit Iām pretty sure it will exhibit the same behavior on Java 9+ The key to producing this bug is to run the code with the module path switches. That is, use java -p <path to target jar> -m <module name/main class> If you run using -classpath then the code will run.
The error message produced by running the NetBeans project is: Error occurred during initialization of boot layer java.lang.module.FindException: Unable to derive module descriptor for /home/koppdk/.m2/repository/xalan/xalan/2.7.2/xalan-2.7.2.jar Caused by: java.lang.module.InvalidModuleDescriptorException: Provider class org.apache.bsf.BSFManager not in module
Ah, sorry, missed that part of the bug-report
Can you reproduce this also outside of NetBeans when run as standalone project? As far as I know none of the active contributors of Apache POI uses NetBeans, so would be good to be able to reproduce it without this "dependency".
Created attachment 37723 [details] Project that can be run without NetBeans To use this version, change into the project directory an then: mvn clean install java -p target/modules -m poiooxmljpmsbroken/com.codebangusllc.poiooxmljpmsbroken.Main
Thanks, this makes it easier to reproduce it. The following error message is actually reported with this now: $ java -p target/modules -m poiooxmljpmsbroken/com.codebangusllc.poiooxmljpmsbroken.Main Error occurred during initialization of boot layer java.lang.module.FindException: Unable to derive module descriptor for target/modules/batik-script-1.13.jar Caused by: java.lang.module.InvalidModuleDescriptorException: Provider class org.apache.batik.bridge.RhinoInterpreterFactory not in module
I can reproduce it on IntelliJ. I'm not sure why our junit-tests don't fail ... yet. Further reading: https://stackoverflow.com/questions/54682417/java-11-unable-to-derive-module-descriptor
Regarding "Provider class org.apache.batik.bridge.RhinoInterpreterFactory not in module": see https://issues.apache.org/jira/browse/BATIK-1260
Created attachment 37725 [details] Fixed project Fixed project attached > mvn clean package > java --module-path target/modules --module poiooxmljpmsbroken Batik maven descriptors seems to be broken, i.e. beside batik-all most of the other artifacts are included. I try to update the dependencies to try to get rid of batik-script
batik-script dropped in r1887643
As far as I see this was adjusted some more via r1893289 by excluding batik from the default dependencies and thus this should work in recent releases.
It does work