Topics

Error "java.lang.NoSuchMethodError" #DITA-OT #specialization #conditional-processing #branch-filtering

@l3arn4life
 

Hi everyone,

we’re trying to upgrade our dita-ot from 2.5.4 to the newest version. I copied our custom plugins to the new dita-ot directory and integrated them using the dita install-command. Now, even when trying to build output using the command line, I get the following error: Error: java.lang.NoSuchMethodError: 'net.sf.saxon.s9api.Processor org.dita.dost.util.XMLUtils.getProcessor()'

I ran the build-command using --debug and --logfile, the last part of the log says

build-init:

preprocess.init:
[pathconvert] Set property dita.map.filename.root = startHere
     [echo] *****************************************************************
     [echo] * input = C:\Users\ESC\Desktop\test_html\startHere\startHere.ditamap
Property "args.resources" has not been set
     [echo] * resources = ${args.resources}
     [echo] *****************************************************************

ditaval-merge:

gen-list:
Job not found from Ant project reference
 [gen-list] Using Xerces grammar pool for DTD and schema caching.
  [antcall] Exiting C:\Perforce\DocMain\2_DITA\ditaOT_3.5.2\build.xml.
Error: java.lang.NoSuchMethodError: 'net.sf.saxon.s9api.Processor org.dita.dost.util.XMLUtils.getProcessor()'

The project I used to test this is based on a sample project modified by Radu, it can be found here. I only added keyspaces and changed the title of the topic to include a keyspace-specific key.
Some of the things I tried so far:
- updated environment variables for dita
- updated openJDK (and respective environment variables)
- installed the newest Saxon add-on (via Oxygen)
- searched our custom framework to find parts that would point to a different version of dita-ot, replaced them with ${configured.ditaot.dir} (this is in Oxygen)
None of the measures helped. Regardless of whether I tried to build output via the command line or from Oxygen, I always get an error. I’m completely out of my depth with this problem, any help will be greatly appreciated.

Many thanks,
Ed

Radu Coravu
 

Hi Ed,

DITA OT 3.5.2 comes with a very new Saxon XSLT processor in its "lib" folder "Saxon-HE-9.9.1-4.jar".

You seem to be running the publishing with an older Saxon JAR library. How exactly do you start the DITA OT from the command line?

Do you use the "dita" script or have you created your own ANT build files with your own Java classpath pointing to various JAR libraries?

Regards,
Radu
Radu Coravu
Oxygen XML Editor
On 7/16/20 11:20 AM, schmidt.eduard@... wrote:

Hi everyone,

we’re trying to upgrade our dita-ot from 2.5.4 to the newest version. I copied our custom plugins to the new dita-ot directory and integrated them using the dita install-command. Now, even when trying to build output using the command line, I get the following error: Error: java.lang.NoSuchMethodError: 'net.sf.saxon.s9api.Processor org.dita.dost.util.XMLUtils.getProcessor()'

I ran the build-command using --debug and --logfile, the last part of the log says

build-init:

preprocess.init:
[pathconvert] Set property dita.map.filename.root = startHere
     [echo] *****************************************************************
     [echo] * input = C:\Users\ESC\Desktop\test_html\startHere\startHere.ditamap
Property "args.resources" has not been set
     [echo] * resources = ${args.resources}
     [echo] *****************************************************************

ditaval-merge:

gen-list:
Job not found from Ant project reference
 [gen-list] Using Xerces grammar pool for DTD and schema caching.
  [antcall] Exiting C:\Perforce\DocMain\2_DITA\ditaOT_3.5.2\build.xml.
Error: java.lang.NoSuchMethodError: 'net.sf.saxon.s9api.Processor org.dita.dost.util.XMLUtils.getProcessor()'

The project I used to test this is based on a sample project modified by Radu, it can be found here. I only added keyspaces and changed the title of the topic to include a keyspace-specific key.
Some of the things I tried so far:
- updated environment variables for dita
- updated openJDK (and respective environment variables)
- installed the newest Saxon add-on (via Oxygen)
- searched our custom framework to find parts that would point to a different version of dita-ot, replaced them with ${configured.ditaot.dir} (this is in Oxygen)
None of the measures helped. Regardless of whether I tried to build output via the command line or from Oxygen, I always get an error. I’m completely out of my depth with this problem, any help will be greatly appreciated.

Many thanks,
Ed


@l3arn4life
 

I use the standard procedure described here. The exact command is (I wont list the complete directories since they’re irrelevant I think):

dita
--input=file.ditamap
--output=desktop\folder
--format=html5
--debug
--logfile=logfile.log

I did not create my own ANT build files as at this stage I would’t even know where to start with such an endeavor.

Best, Ed

Radu Coravu
 

Hi Ed,

Can you give a list with all the custom plugins you installed in DITA OT 3.4.1?

Also just to make sure, you did not copy the DITA OT 3.4.1 installation over the older 2.x installation, right? Because in this way you could have ended up with older Java JAR libraries in the updated installation.

Regards,
Radu
Radu Coravu
Oxygen XML Editor
On 7/16/20 4:43 PM, schmidt.eduard@... wrote:

I use the standard procedure described here. The exact command is (I wont list the complete directories since they’re irrelevant I think):

dita
--input=file.ditamap
--output=desktop\folder
--format=html5
--debug
--logfile=logfile.log

I did not create my own ANT build files as at this stage I would’t even know where to start with such an endeavor.

Best, Ed


@l3arn4life
 

Hi Radu,
I think I might have found the culprit: I tried to generate output using DITA-OT 3.5.2. Our customized plugins rely on Oxygen plugins, so I naturally copied Oxygen plugins from their installation directory into the new DITA-OT directory along with our customized plugins. It looks like Oxygen has issues with running a newer DITA-OT than the one it was installed with and somehow that affects seemingly unrelated transformations. Your last response and the mention of DITA-OT 3.4.1 (instead of 3.5.2) made me think, so I downloaded a "naked" 3.4.1, ran a html5-transformation and things turned out mostly fine.
However, the problem described here still persists and I wonder, whether it will be taken care of in the near future or not. Using <topicref keyref="topic" href="path/topic.dita"/> kind of defeats the purpose of using keys in the first place it seems. Is there a way to "vote" on issues to make them more visible and push them up in priority for development?

Thanks,
Ed

Radu Coravu
 

Hi Ed,

If you look inside a DITA OT bundled with Oxygen, it has in the "plugins" folder a plugin named "com.oxygenxml.dost.patches". That plugin depends very much on the DITA OT version, if installed in another DITA OT version it will break the publishing. So I think you might have also copied this plugin to the DITA OT 3.5.2 installation, which would explain why the publishing did not work.

We do not yet officially support DITA OT 3.5.2 with our publishing plugins, we have updated them internally but we'll officially support them in Oxygen 23 (November 2020).

My advice to you if you want to use our plugins is to use our DITA OT publishing engine distribution:

https://www.oxygenxml.com/publishing_engine.html

It comes with DITA OT 3.4.2 with all our plugins pre-installed.

About this problem:

https://github.com/dita-ot/dita-ot/issues/3370

it seems to be still opened so for now I do not have a workaround for you.

Regards,
Radu
Radu Coravu
Oxygen XML Editor
On 7/20/20 9:51 AM, schmidt.eduard@... wrote:

Hi Radu,
I think I might have found the culprit: I tried to generate output using DITA-OT 3.5.2. Our customized plugins rely on Oxygen plugins, so I naturally copied Oxygen plugins from their installation directory into the new DITA-OT directory along with our customized plugins. It looks like Oxygen has issues with running a newer DITA-OT than the one it was installed with and somehow that affects seemingly unrelated transformations. Your last response and the mention of DITA-OT 3.4.1 (instead of 3.5.2) made me think, so I downloaded a "naked" 3.4.1, ran a html5-transformation and things turned out mostly fine.
However, the problem described here still persists and I wonder, whether it will be taken care of in the near future or not. Using <topicref keyref="topic" href="path/topic.dita"/> kind of defeats the purpose of using keys in the first place it seems. Is there a way to "vote" on issues to make them more visible and push them up in priority for development?

Thanks,
Ed