Uploaded image for project: 'Batik'
  1. Batik
  2. BATIK-1318

rasterizer validate throws NPE

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.14
    • 1.18
    • SVG Rasterizer
    • None

    Description

      Using the cli I encounter an NPE whenever I use the `validate` option. I'm assuming no one but this gnarly old fogey ever tries

       

      ```minimal.svg

      <?xml version="1.0" encoding="UTF-8" standalone="no"?>
      <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
      <svg width="100" height="100" xmlns="http://www.w3.org/2000/svg">
          <rect fill="#ff0000" x="0" y="0" width="50" height="50"/>
      </svg>

      ```

       

      ```shell

      java -jar ~/bin/batik-1.14/batik-rasterizer-1.14.jar -validate minimal.svg

      ```

       

      ```stacktrace

      About to transcode 1 SVG file(s)

      Converting minimal.svg to minimal.png ... java.lang.NullPointerException
          at org.apache.batik.anim.dom.SAXSVGDocumentFactory.resolveEntity(SAXSVGDocumentFactory.java:392)
          at java.xml/com.sun.org.apache.xerces.internal.util.EntityResolverWrapper.resolveEntity(EntityResolverWrapper.java:111)
          at java.xml/com.sun.org.apache.xerces.internal.impl.XMLEntityManager.resolveEntityAsPerStax(XMLEntityManager.java:1025)
          at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch(XMLDocumentScannerImpl.java:1142)
          at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next(XMLDocumentScannerImpl.java:1040)
          at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:943)
          at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605)
          at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
          at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:534)
          at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:888)
          at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:824)
          at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
          at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1216)
          at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:635)
          at org.apache.batik.dom.util.SAXDocumentFactory.createDocument(SAXDocumentFactory.java:453)
          at org.apache.batik.dom.util.SAXDocumentFactory.createDocument(SAXDocumentFactory.java:357)
          at org.apache.batik.anim.dom.SAXSVGDocumentFactory.createDocument(SAXSVGDocumentFactory.java:203)
          at org.apache.batik.anim.dom.SAXSVGDocumentFactory.createDocument(SAXSVGDocumentFactory.java:283)
          at org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(XMLAbstractTranscoder.java:129)
          at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(SVGAbstractTranscoder.java:158)
          at org.apache.batik.apps.rasterizer.SVGConverter.transcode(SVGConverter.java:1008)
          at org.apache.batik.apps.rasterizer.SVGConverter.execute(SVGConverter.java:719)
          at org.apache.batik.apps.rasterizer.Main.execute(Main.java:954)
          at org.apache.batik.apps.rasterizer.Main.main(Main.java:1007)
      ... error (SVGConverter.error.while.rasterizing.file)

      ```

      Attachments

        Issue Links

          Activity

            People

              ssteiner Simon Steiner
              Robert Kosten Robert Kosten
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: