You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlgraphics.apache.org by "stanio (via GitHub)" <gi...@apache.org> on 2023/10/12 14:35:50 UTC

[PR] BATIK-1318: NullPointerException in SAXSVGDocumentFactory.resolveEntity() [xmlgraphics-batik]

stanio opened a new pull request, #40:
URL: https://github.com/apache/xmlgraphics-batik/pull/40

   Suggested fix for [BATIK-1318].
   
   In 2014 the `SAXSVGDocumentFactory` class along with the `dtdids.properties` resource have been moved from `org.apache.batik.dom.svg` to `org.apache.batik.anim.dom` package:
   
   -   412c7bb1ede09d81e9a2125542439a762ba1c501  removed cyclic dependencies reported in [BATIK-1098]
   
   However, the resources referenced in `dtdids.properties` are still in `org.apache.batik.dom.svg` package:
   
   -   [batik-svg-dom/src/main/resources/org/apache/batik/dom/svg/resources/](https://github.com/apache/xmlgraphics-batik/tree/42f696530256dd1bfeec4870922c208d67c0c128/batik-svg-dom/src/main/resources/org/apache/batik/dom/svg/resources)
   
   This makes the following `Class.getResource()` return `null` and ultimately cause NPE:
   
   https://github.com/apache/xmlgraphics-batik/blob/42f696530256dd1bfeec4870922c208d67c0c128/batik-anim/src/main/java/org/apache/batik/anim/dom/SAXSVGDocumentFactory.java#L386-L392
   
   I can see the overall issue has been partially addressed in f2dac46c5e23f830321829eda248fecafce443f9.  I suggest further the `dtdids.properties` should be updated with absolute resource names.
   
   [BATIK-1098]: https://issues.apache.org/jira/browse/BATIK-1098 "Circular dependencies between submodules"
   [BATIK-1318]: https://issues.apache.org/jira/browse/BATIK-1318 "rasterizer validate throws NPE"
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org


Re: [PR] BATIK-1318: NullPointerException in SAXSVGDocumentFactory.resolveEntity() [xmlgraphics-batik]

Posted by "stanio (via GitHub)" <gi...@apache.org>.
stanio commented on PR #40:
URL: https://github.com/apache/xmlgraphics-batik/pull/40#issuecomment-2049757709

   Now that 04b46fd1386bfab2e57bee6a86d229a336a2225a is checked into the main line, one may need to add (haven't tested it explicitly):
   
   ```
   --add-opens org.apache.xmlgraphics.batik.svgdom/org.apache.batik.dom.svg.resources=org.apache.xmlgraphics.batik.anim
   ```
   
   when using the `--module-path` vs. `--class-path` runtime configuration.  This could be further addressed by more appropriate packaging.  For example, `SAXSVGDocumentFactory` (and `dtdids.properties`) should likely reside in the `batik-dom` module, where the rest of the referenced resources are.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org