Olivier Schmitt created TIKA-2678:
-------------------------------------

             Summary: Bug in TikaConfig / ServiceLoader
                 Key: TIKA-2678
                 URL: https://issues.apache.org/jira/browse/TIKA-2678
             Project: Tika
          Issue Type: Bug
          Components: config
    Affects Versions: 1.18
            Reporter: Olivier Schmitt


I have been puzzled by inability to turn off warning messages on the console 
during service loading, such as :
{code:java}
[12:36:28]  Jun 20, 2018 12:36:28 PM 
org.apache.tika.config.InitializableProblemHandler$3 
handleInitializableProblem{code}
Looking through the java source code, I can see that the problem may be in this 
method:
{code:java}
TikaConfig.XmlLoader.loadOne(){code}
In this method, we initialize the initializableProblemHandler using default or 
using the user settings from xml config file, but this variable doesn't seem to 
get passed down to the createComposite() code or the service loader, so in the 
end the user settings from xml configuration file do not get taken into account.

For reference, I have defined my tika config xml as so:
{code:java}
<?xml version="1.0" encoding="UTF-8"?>
<properties>
<parsers>
<!-- Default Parser for most things, except for 2 mime types, and never
use the Executable Parser -->
<parser class="org.apache.tika.parser.DefaultParser" 
initializableProblemHandler="IGNORE">
<mime-exclude>image/jpeg</mime-exclude>
<mime-exclude>application/pdf</mime-exclude>
<parser-exclude class="org.apache.tika.parser.executable.ExecutableParser"/>
</parser>
<!-- Use a different parser for PDF -->
<parser class="org.apache.tika.parser.EmptyParser">
<mime>application/pdf</mime>
</parser>
</parsers>
</properties>{code}
I am specifically trying to turn off messages for 
org.apache.tika.parser.pdf.PDFParser



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to