[Geoserver-devel] [JIRA] (GEOS-9729) WMS XML Post request fails with Workspace qualifier in url

Imran Rajjad created an issue

GeoServer / BugGEOS-9729

WMS XML Post request fails with Workspace qualifier in url

Issue Type:

BugBug

Affects Versions:

2.18-RC

Assignee:

Unassigned

Components:

WMS

Created:

08/Sep/20 8:41 AM

Priority:

MediumMedium

Reporter:

Imran Rajjad

Steps to re-produce:

For the below GetMap request in XML format

<?xml version=“1.0” encoding=“UTF-8”?>
<ogc:GetMap xmlns:ogc=“http://www.opengis.net/ows
xmlns:gml=“http://www.opengis.net/gml
version=“1.1.1” service=“WMS”>
<StyledLayerDescriptor version=“1.0.0”>
<NamedLayer>
<Name>topp:states</Name>
<NamedStyle><Name>population</Name></NamedStyle>
</NamedLayer>
</StyledLayerDescriptor>
<BoundingBox srsName=“http://www.opengis.net/gml/srs/epsg.xml#4326”>
<gml:coord><gml:X>-130</gml:X><gml:Y>24</gml:Y></gml:coord>
<gml:coord><gml:X>-55</gml:X><gml:Y>50</gml:Y></gml:coord>
</BoundingBox>
<Output>
<Format>image/png</Format>
<Size><Width>550</Width><Height>250</Height></Size>
</Output>
</ogc:GetMap>

Make a POST request with workspace as part of URL.

curl -u admin:geoserver -H “Content-Type: text/xml” -X POST http://localhost:8080/geoserver/topp/wms --data @wms_post.xml

The request will fail with error message:

<?xml version=“1.0” encoding=“UTF-8”?><ows:ExceptionReport xmlns:xs=“http://www.w3.org/2001/XMLSchema” xmlns:ows=“http://www.opengis.net/ows” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” version=“1.0.0” xsi:schemaLocation=“http://www.opengis.net/ows http://localhost:8080/geoserver/schemas/ows/1.0.0/owsExceptionReport.xsd”>
<ows:Exception exceptionCode=“NoApplicableCode”>
<ows:ExceptionText>java.lang.NullPointerException</ows:ExceptionText>
</ows:Exception>
</ows:ExceptionReport>

The root cause:

The Null pointer error is being generated from https://github.com/geoserver/geoserver/blob/master/src/wms/src/main/java/org/geoserver/wms/WMSWorkspaceQualifier.java#L28

There is no NULL check on rawKvp in requests, which are NULL for XML payload based post requests.

Add Comment

Add Comment

Get Jira notifications on your phone! Download the Jira Cloud app for Android or iOS


This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100145-sha1:9e8df96)

Atlassian logo