[jira] [Commented] (BATIK-1260) Java11 module-info batik-script/batik-bridge issue w/ RhinoInterpreterFactory
"Roman Valls Guimera (JIRA)" <[email protected]> Mon, 8 Jul 2019 03:57:00 +0000 (UTC)
| Newsgroups | gmane.text.xml.batik.devel |
|---|---|
| Message-ID | <[email protected]> |
[ https://issues.apache.org/jira/browse/BATIK-1260?page=3Dcom.atlassian=
.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1688=
0014#comment-16880014 ]=20
Roman Valls Guimera commented on BATIK-1260:
--------------------------------------------
The problem is clearly the batik-script jar file:
=C2=A0
{{$ jar --file=3D./batik-script-1.12.0-SNAPSHOT.jar --describe-module}}
{{Kan inte h=C3=A4rleda moduldeskriptor f=C3=B6r: ./batik-script-1.12.0-SNA=
PSHOT.jar}}
{{Provider class org.apache.batik.bridge.RhinoInterpreterFactory not in mod=
ule}}
=C2=A0
So disabling Rhino altogether (luckily my app does not use any of that), se=
ems to work via this simple comment/change:
=C2=A0
{{diff --git a/batik-script/src/main/resources/META-INF/services/org.apache=
.batik.script.InterpreterFactory b/batik-script/src/main/resources/META-INF=
/services/org.apache.batik.script.InterpreterFactory}}
{{index 4912fea64..ad9f485c4 100644}}
{{--- a/batik-script/src/main/resources/META-INF/services/org.apache.batik.=
script.InterpreterFactory}}
{{+++ b/batik-script/src/main/resources/META-INF/services/org.apache.batik.=
script.InterpreterFactory}}
{{@@ -23,7 +23,7 @@}}
{{ # ECMAScript}}
{{-org.apache.batik.bridge.RhinoInterpreterFactory}}
{{+#org.apache.batik.bridge.RhinoInterpreterFactory}}
{{ # TCL}}
{{ #org.apache.batik.script.jacl.JaclInterpreterFactory}}
{{ # Python}}
=C2=A0
If you are running your dependency management via Gradle instead of (still)=
juggling with jars under /lib, this should work too (again, assuming your =
app does not need this functionality). Under Gradle:
=C2=A0
{{configurations {}}
{{ implementation {}}{{(...)}}{{exclude group: 'org.apache.xmlgraphics', mo=
dule: 'batik-script'(...)}}
> Java11 module-info batik-script/batik-bridge issue w/ RhinoInterpreterFac=
tory
> -------------------------------------------------------------------------=
----
>
> Key: BATIK-1260
> URL: https://issues.apache.org/jira/browse/BATIK-1260
> Project: Batik
> Issue Type: Bug
> Components: Bridge, Scripting
> Affects Versions: 1.11
> Environment: openjdk 11.0.2 2019-01-15
> OpenJDK Runtime Environment 18.9 (build 11.0.2+9)
> OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)
> Reporter: Roman Valls Guimera
> Priority: Major
> Labels: test
>
> Hello Batik devs,
> I'm refreshing a legacy genomics visualization application (IGV) towards =
Java11 dependencies:
> [https://github.com/igvteam/igv/pull/620]
> I've found the following Java11+Batik hiccups.
> When I use the following maven artifacts to fix a SVG issue in the applic=
ation I'm working on:
> [https://github.com/igvteam/igv/pull/620/commits/f30bc3699856afa68277595a=
2392c2f34392c165]
> **Everything works in runtime** (as in _./gradlew run_ and then File->Sav=
e Image as SVG, generates a correct .svg).
> But strangely, *when running the tests* (as in _./gradlew test_) I'm face=
d with this:
> =C2=A0
> {code:java}
> Error occurred during initialization of boot layer
> java.lang.module.FindException: Unable to derive module descriptor for /U=
sers/romanvg/.gradle/caches/modules-2/files-2.1/org.apache.xmlgraphics/bati=
k-script/1.11/f7284dabc28aaa7407bef45f31dd204e58a35810/batik-script-1.11.ja=
r
> Caused by: java.lang.module.InvalidModuleDescriptorException: Provider cl=
ass org.apache.batik.bridge.RhinoInterpreterFactory not in module
> Process 'Gradle Test Executor 46' finished with non-zero exit value 1
> org.gradle.process.internal.ExecException: Process 'Gradle Test Executor =
46' finished with non-zero exit value 1
> {code}
> Here's a more detailed TravisCI run and Gradle scan, for reference:
> [https://travis-ci.org/umccr/igv/builds/514966124]
> [https://scans.gradle.com/s/z3oulnfefttkm/console-log]
> Then my first attempt is to just exclude _batik-bridge_ and _batik-script=
_ via Gradle:
> {code:java}
> exclude group: 'org.apache.xmlgraphics', module: 'batik-bridge'
> exclude group: 'org.apache.xmlgraphics', module: 'batik-script' =C2=A0
> {code}
> =C2=A0
> But unfortunately this goes further down the dependencies rabbit hole wi=
th xalan, bsf et al:
> {code:java}
> Error occurred during initialization of boot layer java.lang.module.FindE=
xception: Unable to derive module descriptor for /Users/romanvg/.gradle/cac=
hes/modules-2/files-2.1/xalan/xalan/2.7.2/d55d3f02a56ec4c25695fe67e1334ff8c=
2ecea23/xalan-2.7.2.jar Caused by: java.lang.module.InvalidModuleDescriptor=
Exception: Provider class org.apache.bsf.BSFManager not in module Process '=
Gradle Test Executor 188' finished with non-zero exit value 1{code}
> Can somebody tell me if in _batik-script-1.11.jar_ the Java11 module-info=
.class, services, etc... We have not found a module descriptor within the _=
batik-script_=C2=A0jar. We suspect that the RhinoInterpreterFactory service=
reference=C2=A0points to a different=C2=A0jar file, namely:
> =C2=A0
> {code:java}
> org.apache.batik.script.InterpreterFactory ->=C2=A0 org.apache.batik.brid=
ge.RhinoInterpreterFactory=C2=A0
> {code}
> Is there an easy fix so that the _RhinoInterpreterFactory_ error does not=
show up in the first place?
> Thanks in advance for any hint!
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)