[
https://issues.apache.org/jira/browse/TIKA-3551?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17445366#comment-17445366
]
Hudson commented on TIKA-3551:
------------------------------
FAILURE: Integrated in Jenkins build Tika ยป tika-main-jdk8 #359 (See
[https://ci-builds.apache.org/job/Tika/job/tika-main-jdk8/359/])
TIKA-3551 TikaConfig: unspecified attribute of "xml-reader-utils" breaks
configuration file parser (#452) (github:
[https://github.com/apache/tika/commit/9d6a87576908ba2a27ecd403bae1a708ceb93483])
* (edit) tika-core/src/main/java/org/apache/tika/config/TikaConfig.java
* (edit) tika-core/src/test/java/org/apache/tika/config/TikaConfigTest.java
* (add)
tika-core/src/test/resources/org/apache/tika/config/TIKA-3551-xmlreaderutils.xml
> TikaConfig: unspecified attribute of "xml-reader-utils" breaks configuration
> file parser
> ----------------------------------------------------------------------------------------
>
> Key: TIKA-3551
> URL: https://issues.apache.org/jira/browse/TIKA-3551
> Project: Tika
> Issue Type: Bug
> Components: config
> Affects Versions: 1.27, 2.1.0
> Reporter: Sebastian Nagel
> Priority: Major
> Fix For: 2.1.1
>
>
> The Tika configuration file parser exits with an exception when the
> XMLReaderUtils are configured in tika-config.xml without specifying all
> possible attributes, eg. without the attribute maxEntityExpansions (to use
> the default value):
> {noformat}
> <xml-reader-utils poolSize="20" />
> {noformat}
> There's a test whether the attribute value is null - however,
> [getAttribute()|https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Element.html#getAttribute-java.lang.String-]
> returns the empty string if the attribute is not present. The empty string
> then causes a NumberFormatException:
> {noformat}
> 2021-09-14 09:57:12,357 ERROR o.a.n.p.t.TikaParser [main] Problem loading
> custom Tika configuration from tika-config.xml
> java.lang.NumberFormatException: For input string: ""
> at
> java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
> ~[?:?]
> at java.lang.Integer.parseInt(Integer.java:662) ~[?:?]
> at java.lang.Integer.parseInt(Integer.java:770) ~[?:?]
> at
> org.apache.tika.config.TikaConfig.updateXMLReaderUtils(TikaConfig.java:303)
> ~[tika-core-1.25.jar:1.25]
> at org.apache.tika.config.TikaConfig.<init>(TikaConfig.java:192)
> ~[tika-core-1.25.jar:1.25]
> at org.apache.tika.config.TikaConfig.<init>(TikaConfig.java:182)
> ~[tika-core-1.25.jar:1.25]
> at org.apache.tika.config.TikaConfig.<init>(TikaConfig.java:157)
> ~[tika-core-1.25.jar:1.25]
> at
> org.apache.nutch.parse.tika.TikaParser.setConf(TikaParser.java:276)
> [parse-tika.jar:?]
> {noformat}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)