New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE in ForceUniqueFilter #2657

Closed
raducoravu opened this Issue Apr 12, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@raducoravu
Member

raducoravu commented Apr 12, 2017

Our QA team found this:

    E:\KiTuri\qa\oxygen\frameworks\dita\DITA-OT2.x\plugins\org.dita.base\build_preprocess.xml:290:
    java.lang.NullPointerException
        at
    org.dita.dost.writer.ForceUniqueFilter.generateCopyToTarget(ForceUniqueFilter.java:101)
        at
    org.dita.dost.writer.ForceUniqueFilter.startElement(ForceUniqueFilter.java:67)
        at
    org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
        at
    org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown
    Source)
        at
    org.ditang.relaxng.defaults.RelaxNGDefaultsComponent.emptyElement(Unknown
    Source)
        at
    org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
    Source)
        at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
    Source)
        at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
    Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at
    org.ditang.relaxng.defaults.RelaxDefaultsParserConfiguration.parse(Unknown
    Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at org.xml.sax.helpers.XMLFilterImpl.parse(Unknown Source)
        at org.xml.sax.helpers.XMLFilterImpl.parse(Unknown Source)
        at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:451)
        at net.sf.saxon.event.Sender.send(Sender.java:153)
        at
    net.sf.saxon.jaxp.IdentityTransformer.transform(IdentityTransformer.java:375)
        at org.dita.dost.util.XMLUtils.transformFile(XMLUtils.java:391)
        at org.dita.dost.util.XMLUtils.transform(XMLUtils.java:346)
        at org.dita.dost.util.XMLUtils.transform(XMLUtils.java:335)
        at org.dita.dost.module.CopyToModule.processMap(CopyToModule.java:91)
        at org.dita.dost.module.CopyToModule.execute(CopyToModule.java:65)
        at
    org.dita.dost.pipeline.PipelineFacade.execute(PipelineFacade.java:70)
        at
    org.dita.dost.invoker.ExtensibleAntInvoker.execute(ExtensibleAntInvoker.java:222)
        at
    org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
        at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at
    org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:435)
        at org.apache.tools.ant.Target.performTasks(Target.java:456)
        at
    org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405) 

If I find some samples to reproduce the problem I'll be back.

@raducoravu

This comment has been minimized.

Show comment
Hide comment
@raducoravu

raducoravu Apr 12, 2017

Member

It can be reproduced if I have a topic with an invalid ID set on an element:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="lilac">
 <title>Lilac</title>
 <body>
  <p id="li lac"><b>Lilac</b> </p>
 </body>
</topic>

and I refer to it twice in the DITA Map.

Member

raducoravu commented Apr 12, 2017

It can be reproduced if I have a topic with an invalid ID set on an element:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="lilac">
 <title>Lilac</title>
 <body>
  <p id="li lac"><b>Lilac</b> </p>
 </body>
</topic>

and I refer to it twice in the DITA Map.

@jelovirt jelovirt added this to the 2.5 milestone Apr 20, 2017

jelovirt added a commit that referenced this issue Apr 20, 2017

Fix force unique processing when topic doesn’t exist #2657
When topic doesn’t exist either in the source set or is invalid, skip that topic in
unique topic processing.

@jelovirt jelovirt closed this Apr 20, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment