I'm trying to publish a style to geoserver 2.7 via the GeoServerRESTPublisher
class.
If I use the publishStyle(File file) API or the publishStyle(String sldBody) I
get the following error
17:19:55,192 ERROR [stderr] (http-/0.0.0.0:8080-1) [Fatal Error] :1:1: Content
is not allowed in prolog.
17:19:55,193 ERROR [org.geoserver.rest] (http-/0.0.0.0:8080-1) :
java.lang.RuntimeException: org.xml.sax.SAXParseException; lineNumber: 1;
columnNumber: 1; Content is not allowed in prolog.
at org.geotools.styling.SLDParser.parseSLD(SLDParser.java:438)
[gt-main-13.1.jar:]
at org.geoserver.catalog.SLDHandler.parse10(SLDHandler.java:105)
[gs-main-2.7.1-nn-1.jar:2.7.1-nn-1]
at org.geoserver.catalog.SLDHandler.parse(SLDHandler.java:97)
[gs-main-2.7.1-nn-1.jar:2.7.1-nn-1]
at org.geoserver.catalog.rest.StyleFormat.read(StyleFormat.java:91)
[gs-restconfig-2.7.1.jar:2.7.1]
at
org.geoserver.rest.format.StreamDataFormat.toObject(StreamDataFormat.java:34)
[gs-rest-2.7.1.jar:2.7.1]
at
org.geoserver.rest.ReflectiveResource.handlePost(ReflectiveResource.java:118)
[gs-rest-2.7.1.jar:2.7.1]
...
The style xml is below. I formatted it in this email but usually its one long
string. I've tried trimming for whitespace, removing the encoding, and some
other validation checks I've found online. I was wondering if anything stands
out.
<?xml version="1.0" encoding="UTF-8"?>
<sld:StyledLayerDescriptor xmlns="http://www.opengis.net/sld"
xmlns:sld="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc"
xmlns:gml="http://www.opengis.net/gml" version="1.0.0">
<sld:NamedLayer>
<sld:Name>nrdb_threshold_132</sld:Name>
<sld:UserStyle>
<sld:Name>surface air temperature</sld:Name>
<sld:FeatureTypeStyle>
<sld:Name>nrdb_threshold_132</sld:Name>
<sld:FeatureTypeName>Feature</sld:FeatureTypeName>
<sld:Rule>
<sld:RasterSymbolizer>
<sld:ColorMap type="intervals">
<sld:ColorMapEntry color="#FFFF00" opacity="0.0"
quantity="244.16111108888893" label="244.16111108888893"/>
<sld:ColorMapEntry color="#008000" opacity="1.0"
quantity="283.789" label="283.789"/>
</sld:ColorMap>
</sld:RasterSymbolizer>
</sld:Rule>
</sld:FeatureTypeStyle>
</sld:UserStyle>
</sld:NamedLayer>
</sld:StyledLayerDescriptor>
------------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users