You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "Hudson (Jira)" <ji...@apache.org> on 2020/09/09 14:44:00 UTC

[jira] [Commented] (TIKA-3141) LINUX - Tika shouldn't throw an exception for an empty TIKA_CONFIG environment variable value

    [ https://issues.apache.org/jira/browse/TIKA-3141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17192912#comment-17192912 ] 

Hudson commented on TIKA-3141:
------------------------------

UNSTABLE: Integrated in Jenkins build Tika » tika-main-jdk8 #22 (See [https://ci-builds.apache.org/job/Tika/job/tika-main-jdk8/22/])
Tika-3141 -- add empty environment variable handle (#334) (github: [https://github.com/apache/tika/commit/144fe98901b09f6ac329ae906d4c6565c2b33180])
* (edit) tika-core/src/main/java/org/apache/tika/config/TikaConfig.java


> LINUX - Tika shouldn't throw an exception for an empty TIKA_CONFIG environment variable value
> ---------------------------------------------------------------------------------------------
>
>                 Key: TIKA-3141
>                 URL: https://issues.apache.org/jira/browse/TIKA-3141
>             Project: Tika
>          Issue Type: Bug
>          Components: config
>    Affects Versions: 1.20
>         Environment: Any Linux distro.  I'm running the bash shell.  Not sure about other platforms.
>            Reporter: Josh Burchard
>            Priority: Trivial
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> On my Linux box I configure Tika using the TIKA_CONFIG environment variable to point the Tika server at my config.xml file.   Sometimes, however, I want to clear this variable to use the default config and I noticed that Tika will throw an exception and abort if I do the following:
> export TIKA_CONFIG=''
> Seems like a case that should be handled just by ignoring the empty value (i.e., there's no config to be used so go with the default)  or at the most, log a warning that the variable was detected but it's value is empty, but still carry on using the default config.
> {{Exception in thread "main" java.lang.RuntimeException: Unable to access default configuration}}
>  \{{ at org.apache.tika.config.TikaConfig.getDefaultConfig(TikaConfig.java:410)}}
>  \{{ at org.apache.tika.Tika.<init>(Tika.java:116)}}
>  \{{ at org.apache.tika.server.TikaServerCli.main(TikaServerCli.java:125)}}
>  {{*Caused by: org.apache.tika.exception.TikaException: Specified Tika configuration not found:*}}
>  \{{ at org.apache.tika.config.TikaConfig.getConfigInputStream(TikaConfig.java:317)}}
>  \{{ at org.apache.tika.config.TikaConfig.<init>(TikaConfig.java:254)}}
>  \{{ at org.apache.tika.config.TikaConfig.getDefaultConfig(TikaConfig.java:405)}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)