Actions
Bug #4326
closedNullPointerException in XSLGeneralIncorporate
Start date:
2019-09-30
Due date:
% Done:
100%
Estimated time:
Legacy ID:
Applies to branch:
9.9, trunk
Fix Committed on Branch:
9.9, trunk
Fixed in Maintenance Release:
Platforms:
Description
Possibly related with: https://saxonica.plan.io/issues/2932 Needs some complex steps to reproduce.
- Using the DITA Open Toolkit 3.3.4 downloaded from here: https://www.dita-ot.org/download
- Create a folder somewhere on your disk named "projets en développement", unzip the DITA OT there. It's important to use that French accent character there.
- Open a console, change directory to the "DITA-OT\bin" folder, run:
dita -i ../docsrc/site.ditamap -f html5 -v
- The transformation will end with a NullPointerException, I had to patch the DITA OT code to obtain the full stack trace which I'm pasting below. The NullPointerException can also be reproduced using a hand-built DITA OT kit which has Saxon 9.9 bundled.
[junit] [exec] [mapref] java.lang.NullPointerException
[junit] [exec] [mapref] at net.sf.saxon.style.XSLGeneralIncorporate.getIncludedStylesheet(XSLGeneralIncorporate.java:127)
[junit] [exec] [mapref] at net.sf.saxon.style.StylesheetModule.spliceIncludes(StylesheetModule.java:489)
[junit] [exec] [mapref] at net.sf.saxon.style.XSLGeneralIncorporate.getIncludedStylesheet(XSLGeneralIncorporate.java:158)
[junit] [exec] [mapref] at net.sf.saxon.style.StylesheetModule.spliceIncludes(StylesheetModule.java:489)
[junit] [exec] [mapref] at net.sf.saxon.style.PrincipalStylesheetModule.spliceUsePackages(PrincipalStylesheetModule.java:505)
[junit] [exec] [mapref] at net.sf.saxon.style.PrincipalStylesheetModule.preprocess(PrincipalStylesheetModule.java:331)
[junit] [exec] [mapref] at net.sf.saxon.style.Compilation.compilePackage(Compilation.java:286)
[junit] [exec] [mapref] at net.sf.saxon.style.StylesheetModule.loadStylesheet(StylesheetModule.java:259)
[junit] [exec] [mapref] at net.sf.saxon.style.Compilation.compileSingletonPackage(Compilation.java:107)
[junit] [exec] [mapref] at net.sf.saxon.s9api.XsltCompiler.compile(XsltCompiler.java:785)
[junit] [exec] [mapref] at net.sf.saxon.jaxp.SaxonTransformerFactory.newTemplates(SaxonTransformerFactory.java:149)
[junit] [exec] [mapref] at org.dita.dost.module.XsltModule.execute(XsltModule.java:106)
[junit] [exec] [mapref] at org.dita.dost.ant.ExtensibleAntInvoker.execute(ExtensibleAntInvoker.java:182)
[junit] [exec] [mapref] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
[junit] [exec] [mapref] at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
[junit] [exec] [mapref] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[junit] [exec] [mapref] at java.lang.reflect.Method.invoke(Method.java:498)
[junit] [exec] [mapref] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
[junit] [exec] [mapref] at org.apache.tools.ant.Task.perform(Task.java:350)
[junit] [exec] [mapref] at org.apache.tools.ant.Target.execute(Target.java:449)
[junit] [exec] [mapref] at org.apache.tools.ant.Target.performTasks(Target.java:470)
[junit] [exec] [mapref] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1391)
[junit] [exec] [mapref] at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:36)
[junit] [exec] [mapref] at org.apache.tools.ant.Project.executeTargets(Project.java:1254)
[junit] [exec] [mapref] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:437)
[junit] [exec] [mapref] at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:106)
[junit] [exec] [mapref] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
[junit] [exec] [mapref] at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
[junit] [exec] [mapref] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[junit] [exec] [mapref] at java.lang.reflect.Method.invoke(Method.java:498)
[junit] [exec] [mapref] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
[junit] [exec] [mapref] at org.apache.tools.ant.Task.perform(Task.java:350)
[junit] [exec] [mapref] at org.apache.tools.ant.Target.execute(Target.java:449)
[junit] [exec] [mapref] at org.apache.tools.ant.Target.performTasks(Target.java:470)
[junit] [exec] [mapref] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1391)
[junit] [exec] [mapref] at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
[junit] [exec] [mapref] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[junit] [exec] [mapref] at org.apache.tools.ant.Project.executeTargets(Project.java:1254)
[junit] [exec] [mapref] at org.dita.dost.invoker.Main.runBuild(Main.java:637)
[junit] [exec] [mapref] at org.dita.dost.invoker.Main.startAnt(Main.java:196)
[junit] [exec] [mapref] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[junit] [exec] [mapref] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[junit] [exec] [mapref] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[junit] [exec] [mapref] at java.lang.reflect.Method.invoke(Method.java:498)
You may want to edit the "DITA-OT\bin\dita" script and add first in the classpath your Saxon classes folder so that you can add logging details. I added some logging and patched some Saxon classes but I was not able to understand the problem. The problem has been around for a long time, again it's probably related to the fact that content is cached with one key and then retrieved with a different one.
Please register to edit this issue
Actions