[Geoserver-devel] [jira] (GEOS-5844) WMS virtual service will throw NPE on GetCapabilities w/ more than one layer in workspace

Ian Schneider created BugGEOS-5844
WMS virtual service will throw NPE on GetCapabilities w/ more than one layer in workspace

Issue Type:

BugBug

Affects Versions:

2.3.0

Assignee:

Andrea Aime

Components:

Security, WMS

Created:

10/Jun/13 7:29 PM

Description:

When getcaps request is made for a layer virtual WMS service in a workspace with more than one layer, a NullPointerException will be thrown.

The cause is that LocalWorkspaceCatalogFilter will filter out non-local layers but the resulting filtered iterator will return nulls.

The causal stacktrace appears like:

Caused by: java.lang.NullPointerException: at index 4
at com.google.common.collect.ImmutableList.checkElementNotNull(ImmutableList.java:305)
at com.google.common.collect.ImmutableList.construct(ImmutableList.java:296)
at com.google.common.collect.ImmutableList.copyFromCollection(ImmutableList.java:289)
at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:256)
at org.geoserver.security.SecureCatalogImpl.filterLayers(SecureCatalogImpl.java:343)

This code path can be reached via multiple means though I was not able to reproduce the 2nd.

Reproduced with vanilla 2.3.2 download as per thread:

http://osgeo-org.1560.x6.nabble.com/GetCapabilities-1-1-1-error-td5054416.html

PR tomorrow - complete but ran out of time to cleanup, formalize, issue and test against 2.4.x

Project:

GeoServer

Priority:

MajorMajor

Reporter:

Ian Schneider

This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: [http://www.atlassian.com/software/jira](http://www.atlassian.com/software/jira)