Using same ditaval references under parent map and sub map causes Null Pointer Exception in DITA-OT

35 Views Asked by At

When I try to generate xhtml from the given parent ditamap using dita-ot 3.6.1, the output generations fails with NullPointerException.

BUILD FAILED
C:\Users\Rq1qws\DITA-OT\plugins\org.dita.base\build_preprocess.xml:148: java.lang.NullPointerException
    at org.dita.dost.module.BranchFilterModule.getFilterUtils(BranchFilterModule.java:466)
    at org.dita.dost.module.BranchFilterModule.combineFilterUtils(BranchFilterModule.java:342)
    at org.dita.dost.module.BranchFilterModule.filterTopics(BranchFilterModule.java:418)
    at org.dita.dost.module.BranchFilterModule.filterTopics(BranchFilterModule.java:452)
    at org.dita.dost.module.BranchFilterModule.filterTopics(BranchFilterModule.java:452)
    at org.dita.dost.module.BranchFilterModule.processMap(BranchFilterModule.java:143)
    at org.dita.dost.module.BranchFilterModule.execute(BranchFilterModule.java:102)
    at org.dita.dost.ant.ExtensibleAntInvoker.execute(ExtensibleAntInvoker.java:189)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at jdk.internal.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    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)

Following is the ditamap ,dita and ditaval files used.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "technicalContent/dtd/map.dtd">
<map id="GUID-a3370950-acd0-4982-94f6-ceb1bbfc0fb9">
    <title>parent</title>
    <topichead navtitle="parent">
        <topicgroup>
            <mapref format="ditamap" href="childmap1.ditamap" product="12 13" type="map"/>
            <ditavalref href="dval2.ditaval" format="ditaval" processing-role="resource-only">
                <ditavalmeta>
                    <dvrResourceSuffix name="dvrResourceSuffix">_val2</dvrResourceSuffix>
                </ditavalmeta>
            </ditavalref>
            <ditavalref href="dval1.ditaval" format="ditaval" processing-role="resource-only">
                <ditavalmeta>
                    <dvrResourceSuffix name="dvrResourceSuffix">_CG1</dvrResourceSuffix>
                </ditavalmeta>
            </ditavalref>
        </topicgroup>
    </topichead>
</map>

<map id="GUID-4d8ba036-fa1d-4783-a54b-510678dcef10">
  <title>childmap1</title>
  <topichead navtitle="childmap1">
    <topicgroup>
  <topicref href="topic1.dita" product="11 12" type="topic">
  </topicref>
   <ditavalref href="dval2.ditaval">
    <ditavalmeta><dvrResourceSuffix>_val2</dvrResourceSuffix></ditavalmeta>
  </ditavalref>
  <ditavalref href="dval1.ditaval">
     <ditavalmeta><dvrResourceSuffix>_val1</dvrResourceSuffix></ditavalmeta>
  </ditavalref>
    </topicgroup>
  </topichead>
</map>

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "technicalContent/dtd/topic.dtd">
<topic id="GUID-313a30dd-3573-45e5-b5b6-b9b42944ed19">
    <title>topic1</title>
    <shortdesc/>
    <body>
        <p>Topic 1</p>
    </body>
</topic>


<?xml version="1.0" encoding="UTF-8"?>
<val>
  <prop action="exclude">
  </prop>
   <prop action="include" att="product" val="10">
  </prop>
  <prop action="include" att="product" val="11">
  </prop>
</val>


<?xml version="1.0" encoding="UTF-8"?>
<val>
  <prop action="exclude">
  </prop>
   <prop action="include" att="product" val="12">
  </prop>
  <prop action="include" att="product" val="13">
  </prop>
</val>

When I run the following dita ot command dita --input=C:\Users\R1qwesa\parent.ditamap --format=xhtml

I get this error Error: java.lang.NullPointerException

If I remove the ditaval references. The build succeeds.

1

There are 1 best solutions below

1
Radu Coravu On

Dita ot 3.6.1 is not mantained anymore, I would suggest downloading the latest DITA OT 4.1 and see if it works better with your sample. If you can still reproduce the issue you can try to add an issue on the dita ot issues list: https://github.com/dita-ot/dita-ot/issues