1

I'm attempting to run a recent version of the DITA Open Toolkit on a new machine. However, I am getting the following error when using the dita install command via CL:

Error: 'net.sf.saxon.Configuration.setURIResolver(javax.xml.transform.URIResolver)'

This error occurs when running HTML5 and XHTML plus CSS sample ant files as well:

D:\DITA\DITA-OT_3.7.2\docsrc\samples\ant_sample\sample_xhtml_plus_css.xml:11: The following error occurred while executing this line:
D:\DITA\DITA-OT_3.7.2\plugins\org.dita.base\build.xml:29: The following error occurred while executing this line:
D:\DITA\DITA-OT_3.7.2\plugins\org.dita.base\build_init.xml:73: java.lang.NoSuchMethodError: net.sf.saxon.Configuration.setURIResolver(Ljavax/xml/transform/URIResolver;)V
  at org.dita.dost.util.XMLUtils.<init>(XMLUtils.java:85)
  at org.dita.dost.ant.InitializeProjectTask.execute(InitializeProjectTask.java:46)
  at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:299)
  at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  at java.lang.reflect.Method.invoke(Unknown Source)
  at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
  at org.apache.tools.ant.Task.perform(Task.java:350)
  at org.apache.tools.ant.Target.execute(Target.java:449)
  at org.apache.tools.ant.Target.performTasks(Target.java:470)
  at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1401)
  at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:36)
  at org.apache.tools.ant.Project.executeTargets(Project.java:1264)
  at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:437)
  at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:106)
  at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:299)
  at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  at java.lang.reflect.Method.invoke(Unknown Source)
  at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
  at org.apache.tools.ant.Task.perform(Task.java:350)
  at org.apache.tools.ant.Target.execute(Target.java:449)
  at org.apache.tools.ant.Target.performTasks(Target.java:470)
  at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1401)
  at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:36)
  at org.apache.tools.ant.Project.executeTargets(Project.java:1264)
  at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:437)
  at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:299)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  at java.lang.reflect.Method.invoke(Unknown Source)
  at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
  at org.apache.tools.ant.Task.perform(Task.java:350)
  at org.apache.tools.ant.Target.execute(Target.java:449)
  at org.apache.tools.ant.Target.performTasks(Target.java:470)
  at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1401)
  at org.apache.tools.ant.Project.executeTarget(Project.java:1374)
  at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
  at org.apache.tools.ant.Project.executeTargets(Project.java:1264)
  at org.apache.tools.ant.Main.runBuild(Main.java:818)
  at org.apache.tools.ant.Main.startAnt(Main.java:223)
  at org.apache.tools.ant.launch.Launcher.run(Launcher.java:284)
  at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101)

Total time: 1 second

I've tried using JDK 18, OpenJDK 17, as well as "downgrading" to JDK 13 with the same results (and the same with JRE 1.8).

I've tried with DITA OT builds 3.7.2, 3.6.1, and 3.5.4 all with the same error, as well. I've not been able to find anything so far regarding how to troubleshoot this issue nor other options to try. I will note that oXygen 24.1 HTML transformations work normally and I am was able to successfully copy and run the oXygen dita framework independently (though that's not a practical solution for using the DITA OT).

So the question is how can I get the URIResolver to work so that the DITA Open Toolkit will run? TIA.

  • 1
    So you are running in the command line just "dita -install", right? Did you make any changes inside the DITA OT folder after downloading it? Do you have in your environmental CLASSPATH variable a reference to an older Saxon installation? – Radu Coravu Jun 29 '22 at 10:32
  • @radu-coravu The CLASSPATH variable was the issue pointing to a different (though newer) version of Saxon HE. Saxon HE 10.6 is included in the current build of the DITA OT (v3.7.2) where as I had Saxon HE 11.3 on the CLASSPATH. I also had the Apache XML Resolver on the CLASSPATH and _did_ try removing that, but didn't think to remove the link to Saxon, which is where the problem was. Thanks! – Jason Coleman Jun 29 '22 at 17:55
  • 2
    With pleasure, the DITA OT Java code is very much connected to the particular Saxon libraries bundled with it. As Saxon changes its APIs quite often, usually changing the Saxon libraries even to a newer version used by the DITA OT is not an option. There is an opened issue to update the DITA OT to Saxon 11 in the future: https://github.com/dita-ot/dita-ot/issues/3868 – Radu Coravu Jun 30 '22 at 09:05

0 Answers0