Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.0-alpha2
-
Fix Version/s: 2.0-beta1
-
Component/s: None
-
Labels:None
-
Environment:Ubuntu Jaunty
Description
If a space is added into the resource name of a layer, KML and GML output formats in the layer preview break, and they will break in different ways.
Steps to reproduce:
1) Install and run a fresh install of Geoserver.
2) On the Layers page, click on the "states" layer and then change the layer's resource name to "united states". Make sure you include the space, but ignore the quotes. Click Save.
3) Click on the Layer Preview page, and then preview the "topp:united states" layer in the formats below. Note that that each format errors in different ways. I've included the errors with the formats below
Discussion:
Justin said we should probably disallow having spaces in resource names. Sounds like a good plan. Do we know if customers rely on spaces?
Formats:
KML & GML quick links, and KML (plain) from the dropdown: Errors with a javascript error. http://localhost:8081/geoserver/web/?wicket:bookmarkablePage=:org.geoserver.web.demo.MapPreviewPage (line 1)
syntax error ../wms/kml_reflect?layers=topp:united states
KML (compressed): Google Earth shows a big X where the layer should be.
GML 2: New tab showing:
XML Parsing Error: not well-formed
Location: http://localhost:8081/geoserver/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=topp:united%20states&maxFeatures=50&outputFormat=GML2
Line Number 1, Column 642:
(I've suppressed the long string of XML)
GML3:
<ServiceExceptionReport version="1.2.0" xsi:schemaLocation="http://www.opengis.net/ogc http://schemas.opengis.net/wfs/1.0.0/OGC-exception.xsd">
−
<ServiceException>
java.lang.RuntimeException: Encode failed for _Feature. Cause: INVALID_CHARACTER_ERR: An invalid or illegal XML character is specified.
Encode failed for _Feature. Cause: INVALID_CHARACTER_ERR: An invalid or illegal XML character is specified.
INVALID_CHARACTER_ERR: An invalid or illegal XML character is specified.
</ServiceException>
</ServiceExceptionReport>
Right... we miss a validator to prevent that kind of invalid names. In fact we have to make sure all resource names are valid typenames wfs wise.