Gus Heck created TIKA-4586:
------------------------------
Summary: NPE in buildComposite() method of ConfigBase
Key: TIKA-4586
URL: https://issues.apache.org/jira/browse/TIKA-4586
Project: Tika
Issue Type: Bug
Components: config
Affects Versions: 3.2.2
Reporter: Gus Heck
I encountered the following stack trace today:
{code:java}
Caused by: java.lang.NullPointerException
at org.apache.tika.config.ConfigBase.buildComposite(ConfigBase.java:144)
at
org.apache.tika.metadata.filter.MetadataFilter.load(MetadataFilter.java:47)
at org.apache.tika.config.TikaConfig.<init>(TikaConfig.java:193)
at org.apache.tika.config.TikaConfig.<init>(TikaConfig.java:170)
at org.apache.tika.config.TikaConfig.<init>(TikaConfig.java:162)
at
org.jesterj.ingest.processors.TikaProcessor$Builder.configuredWith(TikaProcessor.java:178)
{code}
debugging reveals that getLocalName() is returning null here:
{code:java}
protected static <P, T> P buildComposite(String compositeElementName, Class<P>
compositeClass,
String itemName, Class<T> itemClass,
Element properties)
throws TikaConfigException, IOException {
if (!properties.getLocalName().equals("properties")) {
throw new TikaConfigException("expect properties as root node");
} {code}
Config file loading at the time was:
{code:java}
<?xml version="1.0" encoding="UTF-8"?>
<properties>
<parsers>
<parser class="org.apache.tika.parser.XMLParser">
<mime>application/xml</mime>
</parser>
</parsers>
</properties>
{code}
This is following an upgrade of tika version so there may be something
non-conformant about that file, but probably an NPE is not the right way to
express the problem even if the config is wrong.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)