Error integrating external DITA-OT

Post here questions and problems related to editing and publishing DITA content.
matt_k
Posts: 32
Joined: Mon Aug 17, 2020 7:16 pm

Error integrating external DITA-OT

Post by matt_k »

I have set up an external DITA-OT version 3.2 to run our custom plugins.
When I try and run integrator.xml from the command line I get this error:

Code: Select all

/dita-ot-3.2/bin/ant -f integrator
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/tools/ant/launch/Launcher : Unsupported major.minor version 52.0
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
	at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
I currently just have the base set of plugins that come with 3.2.
Any idea what the issue here?
Radu
Posts: 8956
Joined: Fri Jul 09, 2004 5:18 pm

Re: Error integrating external DITA-OT

Post by Radu »

Hi,

It looks like some kind of incompatibility between the Java version you are using and the DITA OT.
You should try to use Java 1.8 to run the DITA OT.
Maybe you can run "java -version" in the command line to see what Java version you are using. It may be possible you are using an older Java version like 1.6 or older.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
matt_k
Posts: 32
Joined: Mon Aug 17, 2020 7:16 pm

Re: Error integrating external DITA-OT

Post by matt_k »

Hi Radu
I have Java version "1.6.0_65".
I did manage to get our custom plugins intergrated into my v 3.2.0 external toolkit. However, when I run a transform I get this message now:

Code: Select all

Transformation failed. …/dita-ot-3.2/plugins/com.oxygenxml.pdf.css/build.xml:123: Unable to create javax script engine for javascript
Is that still related to the Java version?
What is strange, is that I am able to run our custom plugins using the Oxygen 24 Built-in DITA-OT 3.x without this error. Our custom plugins were designed to run with 3.2.0 and do so quite happily on our server.
I'll see if I can get our IT team to update my Java.
Regards
Matt
Radu
Posts: 8956
Joined: Fri Jul 09, 2004 5:18 pm

Re: Error integrating external DITA-OT

Post by Radu »

Hi Matt,

This problem is not related to Oxygen's functionality, DITA OT 3.2 is very old, it was released about 4 years ago, I think you should try to use precisely Java 1.8 to run your publishing. Newer versions of Java (9 and newer) do not contain certain libraries that the DITA OT build files need, also there are certain features like the Javascript engine which has been removed entirely in newer Java versions. No commercial publishing plugin developed by us officially supports anymore version 3.2 of the DITA OT.

Oxygen 24's DITA OT is version 3.6.1 which contains various fixes and libraries making it work with any Java version from 1.8 upward to 17.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
matt_k
Posts: 32
Joined: Mon Aug 17, 2020 7:16 pm

Re: Error integrating external DITA-OT

Post by matt_k »

Hi Radu

Thank you so mucn for your reply.

I had suggested using a newer DITA-OT with our developers a while back, but they were reluctant saying that it may introduce problems. I will speak to them again.

In the meantime, I have requested that my versison of Jave be upgraded.

Regards

Matt
matt_k
Posts: 32
Joined: Mon Aug 17, 2020 7:16 pm

Re: Error integrating external DITA-OT

Post by matt_k »

Hi Radu
I will need to keep DITA-OT 3.2 for now.
How do I change the Java Home to point to 1.8 installed on my Mac. I have tried

Code: Select all

/System/Library/Frameworks/JavaVM.framework
But I just get this error:
Error: JAVA_HOME is not defined correctly.
We cannot execute /System/Library/Frameworks/JavaVM.framework/bin/java
How I define it correctly?
Regards
Matt
Radu
Posts: 8956
Joined: Fri Jul 09, 2004 5:18 pm

Re: Error integrating external DITA-OT

Post by Radu »

Hi Matt,
I do not know the status of what Java versions you have installed and where.
If you run "java -version" in the Terminal window what do you get?
How about if you run "which java"?
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
matt_k
Posts: 32
Joined: Mon Aug 17, 2020 7:16 pm

Re: Error integrating external DITA-OT

Post by matt_k »

Hi Radu
Apologies, I should have included that information. My Java version is 1.8:
java -version
java version "1.8.0_391"
Java(TM) SE Runtime Environment (build 1.8.0_391-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.391-b13, mixed mode)
Running which java:
which java
/usr/bin/java
Regards
Matt
Radu
Posts: 8956
Joined: Fri Jul 09, 2004 5:18 pm

Re: Error integrating external DITA-OT

Post by Radu »

Hi Matt,
I guess you could try to set the Java Home value in the transformation scenario to /usr as Oxygen should append "/bin/java" to it and run it.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
matt_k
Posts: 32
Joined: Mon Aug 17, 2020 7:16 pm

Re: Error integrating external DITA-OT

Post by matt_k »

Thanks Radu, that helped. However the transform starts but does not progress.
Executing: 
sh "/Users/XXXXXX/Documents/Local_publishing/DITA_OT/dita-ot-3.2.1/bin/dita" -v -f cii.webhelp -o "/Users/XXXXXX/Documents/Local_publishing/WebHelp/WebHelp colours/introduction_to_motor_insurance_webhelpditamap-bundle/out/webhelp-responsive" -t "/Users/XXXXXX/Documents/Local_publishing/WebHelp/WebHelp colours/introduction_to_motor_insurance_webhelpditamap-bundle/temp/webhelp-responsive/oxygen_dita_temp" "-Dwebhelp.trial.license=no" "-Dwebhelp.publishing.template.descriptor=cii-tiles.opt" "-Dwebhelp.publishing.template=/Users/XXXXXX/Documents/Local_publishing/DITA_OT/dita-ot-3.2.1/plugins/com.cii.webhelp/templates/" "-Dargs.copycss=yes" "-Dargs.css=/Users/XXXXXX/Documents/Local_publishing/DITA_OT/dita-ot-3.2.1/plugins/com.cii.webhelp/templates/cii.css" "-Dargs.figurelink.style=TITLE" "-Dargs.tablelink.style=TITLE" "-Dcii.convert.images=no" "-Dforce-unique=true" "-Dwebhelp.favicon=/Users/XXXXXX/Documents/Local_publishing/DITA_OT/dita-ot-3.2.1/plugins/com.cii.webhelp/templates/images/favicon.png"


Radu
Posts: 8956
Joined: Fri Jul 09, 2004 5:18 pm

Re: Error integrating external DITA-OT

Post by Radu »

Hi,
I'm not sure why that does not work. If you edit the transformation scenario and in the "Advanced" tab you uncheck the "Prefer using the dita command", save the transformation scenario and then run it again does it work better? How about if you edit the scenario again and in the "Additional ANT arguments" text field set "-verbose" (without the quotes) then run it again? This should report more details about what the publishing process is doing.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
matt_k
Posts: 32
Joined: Mon Aug 17, 2020 7:16 pm

Re: Error integrating external DITA-OT

Post by matt_k »

Hi Radu

I unchecked the "Prefer using the dita command", which didn't help, so I applied the "-verbose" argument and found a message about the "args.input' not being set. I had to experiement to find the correct parameter here, but finally got output working by setting this to "{$cf}".

Output is now working as expected, apart from the custom icon images we use with our othertype notes, are not appearing, even though they are included in the output folder.

Many thanks

Regards

Matt
Radu
Posts: 8956
Joined: Fri Jul 09, 2004 5:18 pm

Re: Error integrating external DITA-OT

Post by Radu »

Hi Matt,
I'm glad this works for you now!
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
matt_k
Posts: 32
Joined: Mon Aug 17, 2020 7:16 pm

Re: Error integrating external DITA-OT

Post by matt_k »

Thanks for your help Radu.
I'm even happier now, as I have managed to figure out why the note icons were not displaying. I had used a path to the plugin folder for the args.css, instead of using "${configured.ditaot.dir}".
Post Reply