Page 1 of 1

xmltask usage in plugins using old XPATH API

Posted: Mon Nov 28, 2022 8:50 pm
by easirois
Hi,

I have recently updated to v25 with the updated JDK.

Executing:
"C:\Ixiasoft\og\client-og-6.3\data\dita-ot-2.5.4/bin/dita.bat" -v -f xhtml-client -o C:\Ixiasoft\projects\client\Hazard-and-Warning\Hazards_Warnings_and_Cautions.Export[DRM].English\content\authoring/out/xhtml-client -t C:\Ixiasoft\projects\client\Hazard-and-Warning\Hazards_Warnings_and_Cautions.Export[DRM].English\content\authoring/temp/xhtml-client -i C:\Ixiasoft\projects\client\Hazard-and-Warning\Hazards_Warnings_and_Cautions.Export[DRM].English\content\authoring\nze1529959654580.ditamap "-Dclean.temp=no"

init:

dita2xhtml-client.init:
Error: java.lang.IllegalAccessError: class com.oopsconsultancy.xmltask.jdk15.XPathAnalyser15 (in unnamed module @0x16612a51) cannot access class com.sun.org.apache.xpath.internal.XPathAPI (in module java.xml) because module java.xml does not export com.sun.org.apache.xpath.internal to unnamed module @0x16612a51

From what I can gather from Googling things I need to add the following as JVM option. I still get the error whne I add it to the JVM arguments section of the scenario. What's the best way to resolve this issue?
"--add-opens java.xml/com.sun.org.apache.xpath.internal=ALL-UNNAMED"

If I add "-Dadd-opens=java.xml/com.sun.org.apache.xpath.internal=ALL-UNNAMED" on the command line for the OT (copied from oxygen), then this works fine outside of oxygen. But I can't seem to get it too work inside oxygen via the JVM Argument in the scenario.

Re: xmltask usage in plugins using old XPATH API

Posted: Tue Nov 29, 2022 9:17 am
by Radu
Hi Eric,

So you have a custom DITA OT publishing engine probably delivered by Ixiasoft and you are running it from inside Oxygen XML Editor right?
And more recent versions of Oxygen are bundled with Java 17 which shows such errors when using content that it considers to be non-API.

So:
From what I can gather from Googling things I need to add the following as JVM option. I still get the error whne I add it to the JVM arguments section of the scenario. What's the best way to resolve this issue?
"--add-opens java.xml/com.sun.org.apache.xpath.internal=ALL-UNNAMED"
Indeed the "JVM Arguments" field in the transformation scenario is the proper place where to place the extra add-opens.
This should work, of course there should be an "=" after the "--add-opens" (something like --add-opens=java.xml/com.sun.org.apache.xpath.internal=ALL-UNNAMED)but I suppose you have it like that on your side. You can take a look at the command line line Oxygen creates to run the DITA OT, if it contains that extra "--add-opens" after the path to the Java executable then things should work.
If I add "-Dadd-opens=java.xml/com.sun.org.apache.xpath.internal=ALL-UNNAMED" on the command line for the OT (copied from oxygen), then this works fine outside of oxygen. But I can't seem to get it too work inside oxygen via the JVM Argument in the scenario.
I'm not sure if using "-D..." works, this is used to pass system property name/value pairs. But add-opens instructions are not system properties, they need to have the form --add-opens=java.base/java.net=ALL-UNNAMED

Regards,
Radu

Re: xmltask usage in plugins using old XPATH API

Posted: Wed Nov 30, 2022 1:45 am
by sprentice
I've run into a similar situation with the xmltask ant task (v. 1.16 from oopsconsultancy.com). This is bundled with our dita-ot plugin and works fine on Oxygen 23, but when the same plugin is run from Oxygen 25, it fails. When I grab the xmltask.jar from org.doctales.xmltask (v.1.17 from a fork of the original), this works fine in Oxygen 25. I'm assuming this is some sort of incompatibility with the Java version in Oxygen 25. I may just end up using the JAR file from org.doctales.xmltask, but first, I'll diff the source so I can see what has changed.
No question. Just information that may be helpful to others running into this issue.
...scott