[Geoserver-devel] [JIRA] (GEOS-7712) Importer throws NullPointerException

Erik Merkle created an issue

GeoServer / BugGEOS-7712

Importer throws NullPointerException

Issue Type:

BugBug

Affects Versions:

2.9.1

Assignee:

Unassigned

Components:

Importer

Created:

02/Sep/16 2:01 PM

Environment:

OpenJDK 8 update 101 (64-bit)
RHEL 6.6
GeoServer 2.9.1
Boundless Exchange 1.0.2 (w/ GeoNode 2.5.2)

Priority:

MediumMedium

Reporter:

Erik Merkle

When trying to import Rasters into GeoServer (via GeoNode 2.5.2), the import fails and I see this in the GeoServer logs

01 Sep 08:43:39 WARN [geoserver.importer] - Task failed during import: org.geoserver.importer.ImportTask@anonymised.com
java.lang.NullPointerException
        at org.geoserver.importer.Importer.findUniqueResourceName(Importer.java:1415)
        at org.geoserver.importer.Importer.addToCatalog(Importer.java:1374)
        at org.geoserver.importer.Importer.doDirectImport(Importer.java:940)
        at org.geoserver.importer.Importer.run(Importer.java:848)
        at org.geoserver.importer.Importer.run(Importer.java:802)
        at org.geoserver.importer.Importer$5.call(Importer.java:881)
        at org.geoserver.importer.Importer$5.call(Importer.java:875)
        at org.geoserver.importer.job.Job.call(Job.java:16)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)

When connecting a debugger to GeoServer and repeating, I found that what is causing the NPE is that the Store on the supplied ResourceInfo is null, but only sometimes. If the StoreInfo is null, a NPE is thrown on line 1415 of Importer when it tries to get the Namespace from the Workspae name of the StoreInfo.

This appears to be some sort of race condition as I am unable to reproduce it with the exact same GeoServer WAR on a local dev environment.

In an attempt to work around the issue, I found that getting the Namespace from the supplied ResourceInfo seems to work as intended.

Add Comment

Add Comment

This message was sent by Atlassian JIRA (v1000.305.0#100011-sha1:1dc2d9a)

Atlassian logo