old custom Transformation doesn't work after upgrading Oxygen

Having trouble installing Oxygen? Got a bug to report? Post it all here.
schRad
Posts: 3
Joined: Mon Apr 03, 2023 3:16 pm

old custom Transformation doesn't work after upgrading Oxygen

Post by schRad »

Hey,
i recently got the newest Oxygen Author version 25.1. So far I have worked with Oxygen 16.0, accordingly my projects are also written with Oxygen 16.0. Among other things, I want to apply a personalized PDF transformation scenario to my files, but I get an error message here where the build is completely aborted (with the "normal" PDF transformation I only had a few small error messages that could be quickly fixed). So I conclude that my transformation scenario is somehow incompatible with the new version. Since this was created by my predecessor, it is difficult for me to find my way in.
Using google I have read the hint that it could be due to an outdated Java version, here I already use the latest version.
I attach my error message here, maybe someone can help me.

Code: Select all

BUILD FAILED
C:\Lokal\Manuals\DITA-OT\build.xml:44: The following error occurred while executing this line:
C:\Lokal\Manuals\DITA-OT\plugins\org.dita.base\build_preprocess.xml:124: java.lang.RuntimeException: XPathFactory#newInstance() failed to create an XPathFactory for the default object model: http://java.sun.com/jaxp/xpath/dom with the XPathFactoryConfigurationException: java.util.ServiceConfigurationError: javax.xml.xpath.XPathFactory: jar:file:/C:/Lokal/Manuals/DITA-OT/lib/saxon/saxon9-xpath.jar!/META-INF/services/javax.xml.xpath.XPathFactory:2: Illegal configuration-file syntax
	at java.xml/javax.xml.xpath.XPathFactory.newInstance(XPathFactory.java:119)
	at org.apache.tools.ant.taskdefs.XSLTProcess.init(XSLTProcess.java:1226)
	at org.apache.tools.ant.ComponentHelper.createComponent(ComponentHelper.java:271)
	at org.apache.tools.ant.UnknownElement.makeObject(UnknownElement.java:427)
	at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:165)
	at org.apache.tools.ant.Task.perform(Task.java:349)
	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:292)
	at jdk.internal.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	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:827)
	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)
Caused by: javax.xml.xpath.XPathFactoryConfigurationException: java.util.ServiceConfigurationError: javax.xml.xpath.XPathFactory: jar:file:/C:/Lokal/Manuals/DITA-OT/lib/saxon/saxon9-xpath.jar!/META-INF/services/javax.xml.xpath.XPathFactory:2: Illegal configuration-file syntax
	at java.xml/javax.xml.xpath.XPathFactoryFinder.findServiceProvider(XPathFactoryFinder.java:349)
	at java.xml/javax.xml.xpath.XPathFactoryFinder._newFactory(XPathFactoryFinder.java:212)
	at java.xml/javax.xml.xpath.XPathFactoryFinder.newFactory(XPathFactoryFinder.java:137)
	at java.xml/javax.xml.xpath.XPathFactory.newInstance(XPathFactory.java:172)
	at java.xml/javax.xml.xpath.XPathFactory.newInstance(XPathFactory.java:113)
	... 28 more
Caused by: java.util.ServiceConfigurationError: javax.xml.xpath.XPathFactory: jar:file:/C:/Lokal/Manuals/DITA-OT/lib/saxon/saxon9-xpath.jar!/META-INF/services/javax.xml.xpath.XPathFactory:2: Illegal configuration-file syntax
	at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:593)
	at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:599)
	at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.parseLine(ServiceLoader.java:1147)
	at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.parse(ServiceLoader.java:1177)
	at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.nextProviderClass(ServiceLoader.java:1213)
	at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1228)
	at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1273)
	at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1309)
	at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1393)
	at java.xml/javax.xml.xpath.XPathFactoryFinder$2.run(XPathFactoryFinder.java:338)
	at java.xml/javax.xml.xpath.XPathFactoryFinder$2.run(XPathFactoryFinder.java:334)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
	at java.xml/javax.xml.xpath.XPathFactoryFinder.findServiceProvider(XPathFactoryFinder.java:334)
	... 32 more

PS.: Sorry if this or something similar has already been posted, i couldn't find it through the search function.
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: old custom Transformation doesn't work after upgrading Oxygen

Post by Radu »

Hi,

Oxygen in general comes with its own bundled Java version, for example Oxygen 25.1 comes with Java 17, so Oxygen does not use the Java VM you separately installed on your system but its own Java installation.
There was quite a jump from Oxygen 16 to 25.1. I assume you went to the Oxygen 25.1 Preferences and in the "DITA" preferences page you changed the default DITA OT folder to point to your custom DITA OT installation (C:\Lokal\Manuals\DITA-OT) right? What DITA OT version is that? Probably the old DITA OT version you are using has never been used with Java 17 because it did not exist at that time.
Could you maybe save to a text file, zip and send us (support@oxygenxml.com) the entire console output you receive from the DITA OT when running the transformation from Oxygen? I'm interested also in finding out how the process is started by Oxygen.
Would it be possible for you to also zip and send us the entire custom DITA OT installation that you are using?
We have a tech support form on which you can attach a big zip file:
https://www.oxygenxml.com/techSupport.html

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
schRad
Posts: 3
Joined: Mon Apr 03, 2023 3:16 pm

Re: old custom Transformation doesn't work after upgrading Oxygen

Post by schRad »

Thank you for your answer,
i send you the data through your tech support form.

with kind regards,
schRad
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: old custom Transformation doesn't work after upgrading Oxygen

Post by Radu »

Hi,

Thanks for the samples.
You seem to have encountered an incompatibility between the Saxon 9 XSLT processor bundled with the DITA OT you are using and the Java 17 used by Oxygen 25.1.

https://sourceforge.net/p/saxon/discuss ... /dda095cc/

Here are two possible workarounds for this:

Open Oxygen 25.1, in the main menu "Window->Show view" there is an "Archive Browser" view, show it and open in the Archive Browser this specific saxon9-xpath.jar library from your custom DITA-OT folder:
DITA-OT\lib\saxon\saxon9-xpath.jar
From it open in Oxygen this particular file "META-INF/services/javax.xml.xpath.XPathFactory" as a plain text file.

In the "javax.xml.xpath.XPathFactory" file you will see this content:

Code: Select all

net.sf.saxon.xpath.XPathFactoryImpl

http\://java.sun.com/jaxp/xpath/dom:    net.sf.saxon.xpath.XPathFactoryImpl

http\://saxon.sf.net/jaxp/xpath/om:     net.sf.saxon.xpath.XPathFactoryImpl
...
Leave in the file only the first line and remove the rest, then save the file, Oxygen will also ask if you want to save the archive and you should accept this.

After this try again to publish.

Another workaround is to find a Java 1.6 Virtual Machine version to download, install it on your computer, then in Oxygen 25.1 edit the transformation scenario you are using and in the "Advanced" tab set the "Java Home" folder to point to that Java 1.6 installation and then try to publish.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
schRad
Posts: 3
Joined: Mon Apr 03, 2023 3:16 pm

Re: old custom Transformation doesn't work after upgrading Oxygen

Post by schRad »

Hi Radu,
thank you for that input. I tried both versions and both didn't work.

For the first route, through the archive, i get this new Error-Dialogue

Code: Select all

BUILD FAILED
C:\Lokal\...\DITA-OT\build.xml:44: The following error occurred while executing this line:
C:\Lokal\...\DITA-OT\plugins\org.dita.pdf2\build.xml:164: The following error occurred while executing this line:
C:\Lokal\...\DITA-OT\plugins\org.dita.pdf2\build_fop.xml:175: java.lang.NoClassDefFoundError: org/apache/batik/bridge/FontFamilyResolver
	at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
	at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3373)
	at java.base/java.lang.Class.getConstructor0(Class.java:3578)
	at java.base/java.lang.Class.getDeclaredConstructor(Class.java:2754)
	at org.apache.xmlgraphics.util.Service.providers(Service.java:85)
	at org.apache.xmlgraphics.image.loader.spi.ImageImplRegistry.discoverClasspathImplementations(ImageImplRegistry.java:117)
	at org.apache.xmlgraphics.image.loader.spi.ImageImplRegistry.<init>(ImageImplRegistry.java:81)
	at org.apache.xmlgraphics.image.loader.spi.ImageImplRegistry.<init>(ImageImplRegistry.java:89)
	at org.apache.xmlgraphics.image.loader.spi.ImageImplRegistry.<clinit>(ImageImplRegistry.java:73)
	at org.apache.xmlgraphics.image.loader.ImageManager.<init>(ImageManager.java:64)
	at org.apache.fop.apps.FopFactoryBuilder$FopFactoryConfigImpl.<init>(FopFactoryBuilder.java:413)
	at org.apache.fop.apps.FopFactoryBuilder.<init>(FopFactoryBuilder.java:91)
	at org.apache.fop.apps.FopConfParser.<init>(FopConfParser.java:158)
	at org.apache.fop.apps.FopConfParser.<init>(FopConfParser.java:92)
	at org.apache.fop.apps.FopConfParser.<init>(FopConfParser.java:145)
	at org.apache.fop.apps.FopConfParser.<init>(FopConfParser.java:118)
	at org.apache.fop.tools.anttasks.FOPTaskStarter.<init>(Fop.java:429)
	at org.apache.fop.tools.anttasks.Fop.execute(Fop.java:367)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
	at jdk.internal.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	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:292)
	at jdk.internal.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	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:292)
	at jdk.internal.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	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:827)
	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)
Caused by: java.lang.ClassNotFoundException: org.apache.batik.bridge.FontFamilyResolver
	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:587)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
	... 60 more
could that be because i use svg's in my manuals?

In the second route i just tried to redirect the "java Home" folder to the one that Oxygen 16 uses (it's still installed, for the case that the upgrade would be to much work) and get this Error Message.

Code: Select all

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.defineClass(Unknown Source)
	at java.security.SecureClassLoader.defineClass(Unknown Source)
	at java.net.URLClassLoader.defineClass(Unknown Source)
	at java.net.URLClassLoader.access$100(Unknown Source)
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Exception in thread "main"
 
would it be easier to rebuild the old custom DITA-OT with a newer version?

Thanks in advance
schRad
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: old custom Transformation doesn't work after upgrading Oxygen

Post by Radu »

Hi,

I tried in various ways but I'm afraid I also cannot make this work properly to include in the PDF referenced SVGs.
About this remark:
would it be easier to rebuild the old custom DITA-OT with a newer version?
Ideally PDF customizations should be documented and explained somewhere by the person who did them.
Looking at your "DITA-OT", it seems to have the customizations in the "DITA-OT\plugins\org.dita.pdf2\Customization" folder.
This specific "Customization" folder could be copied outside of the DITA OT, then if in the Oxygen "Preferences->DITA" page you revert to the default used DITA Open Toolkit (the one in Oxygen 25.1) you can edit the transformation scenario you are using to publish and set the "customization.dir" parameter to point to this custom customization folder:
https://www.oxygenxml.com/doc/versions/ ... utput.html
But I do not guarantee this will work, there are various XSLT customizations specific to your company there, and the DITA OT stylesheets have also changed in the meantime so they might no longer work.
In recent Oxygen versions we switched our development effort to providing CSS-based PDF output customizations which are easier to maintain and use. But you would need to manually migrate to CSS based styling, there is no automated conversion from the old XSL-FO based customization directory to CSS based PDF publishing.
https://www.oxygenxml.com/doc/versions/ ... ml5-2.html

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
nkutsche
Posts: 8
Joined: Wed Feb 25, 2015 5:10 pm

Re: old custom Transformation doesn't work after upgrading Oxygen

Post by nkutsche »

Hi Radu,

the user called me today and asked for assistence switching to CSS to fix a DITA-OT problem.
I was a bit confused about the approach, so she pointed me to this topic.

Am I right with my intepretion of your last sentence
In recent Oxygen versions we switched our development effort to providing CSS-based PDF output customizations which are easier to maintain and use. But you would need to manually migrate to CSS based styling, there is no automated conversion from the old XSL-FO based customization directory to CSS based PDF publishing.
that the fix would be to reimplement the DITA-OT customization for the new DITA-OT version and you just recommend to use CSS in future. Or do you think a re-implementation keeping the XSL-FO way wouldn't fix it as well?

BR, Nico
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: old custom Transformation doesn't work after upgrading Oxygen

Post by Radu »

Hi Nico,
the user called me today and asked for assistence switching to CSS to fix a DITA-OT problem.
What is that problem?
I assume the client is using the free DITA to PDF using XSL-FO transformation plugins right now. Do they want to switch to CSS because there are limitations to their current publishing? Or do they just want to benefit of the much easier way in which you can customize CSS using PDF and have customizations which can easily be maintained in the future.
As I said in the quote above, our proprietary DITA to PDF publishing using CSS and our Chemistry PDF processor is a main focus of development for us. We've created lots of webinars and resources showing how CSS can be used to customize the DITA content:
https://www.oxygenxml.com/doc/versions/ ... ation.html
We even created a web site to assist people in creating their CSS:
https://styles.oxygenxml.com/
The XSL-FO based approach will continue to exist but we cannot really invest a lot of time answering XSL-FO related customization questions. If there are people asking for XSL-FO based customizations we usually direct them to the DITA Users List.
About converting XSL-FO customizations to CSS based customizations I'm afraid there is no automatic way to do this.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
nkutsche
Posts: 8
Joined: Wed Feb 25, 2015 5:10 pm

Re: old custom Transformation doesn't work after upgrading Oxygen

Post by nkutsche »

Hi Radu,

thanks for the answer! The problem was, that they interpreted your note (which I had quoted) as a statement that they should switch to CSS to solve the raised errors which was described here in the forum post.
And I had my doubt, that this was your intension. But I'm not so deep in DITA-OT customization and didn't had a look into their code, so I just wanted to clarify.

Thanks!
Post Reply