Bug 65103 - Java application cannot launch using JPMS and POI-OOXML 5.0.0
Summary: Java application cannot launch using JPMS and POI-OOXML 5.0.0
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: POI Overall (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 blocker (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-25 16:59 UTC by codebangusllc
Modified: 2022-04-20 01:52 UTC (History)
0 users



Attachments
NetBeans project that exhibits this bug (4.01 KB, application/zip)
2021-01-25 16:59 UTC, codebangusllc
Details
Project that can be run without NetBeans (6.99 KB, application/zip)
2021-02-01 14:45 UTC, codebangusllc
Details
Fixed project (4.40 KB, application/octet-stream)
2021-02-02 22:15 UTC, Andreas Beeker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description codebangusllc 2021-01-25 16:59:16 UTC
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.
Comment 1 Dominik Stadler 2021-02-01 09:32:51 UTC
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.
Comment 2 Dominik Stadler 2021-02-01 09:36:54 UTC
Also exact version of Java might be helpful to narrow down this.
Comment 3 codebangusllc 2021-02-01 12:34:48 UTC
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.
Comment 4 codebangusllc 2021-02-01 12:58:50 UTC
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
Comment 5 Dominik Stadler 2021-02-01 13:44:35 UTC
Ah, sorry, missed that part of the bug-report
Comment 6 Dominik Stadler 2021-02-01 14:01:05 UTC
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".
Comment 7 codebangusllc 2021-02-01 14:45:38 UTC
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
Comment 8 Dominik Stadler 2021-02-01 16:23:14 UTC
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
Comment 9 Andreas Beeker 2021-02-01 22:52:21 UTC
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
Comment 10 Andreas Beeker 2021-02-02 21:26:36 UTC
Regarding "Provider class org.apache.batik.bridge.RhinoInterpreterFactory not in module":
see https://issues.apache.org/jira/browse/BATIK-1260
Comment 11 Andreas Beeker 2021-02-02 22:15:30 UTC
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
Comment 12 Marius Volkhart 2021-03-14 19:25:47 UTC
batik-script dropped in r1887643
Comment 13 Dominik Stadler 2022-04-19 10:09:38 UTC
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.
Comment 14 codebangusllc 2022-04-20 01:52:59 UTC
It does work