I've got hundreds of SLDs that I want to update in a geoserver instance. All good for most of them but those that reference images fail to get updated.

For example:

            <OnlineResource xlink:href="symbols/airport.svg"/>

I know that the REST api does not support uploading the images but they already exist. If I just paste the sld into web page for the style in geoserver it accepts it and all is good. The problem would appear to be the upload code trying to resolve the link relative to the upload and not the final destination.

The error is

Caused by: java.net.MalformedURLException: no protocol: symbols/airport.svg

Does anyone know a way around this. Manually updating 100s of styles is simply not an option.

2 Answers 2


I work round this by copying the SLD files into the styles folder and then using REST to add the style to GeoServer:

curl -f -s -u admin:geoserver -XPOST -H 'Content-type: text/xml' -d "$payload" http://localhost:8080/geoserver/rest/styles 
  • I was hoping to be able to do this remotely without access to the file system.
    – vickirk
    May 13, 2015 at 20:31

I failed to find a way in geoserver to do this. I had to knock up an additional servlet to run under tomcat that uploads files to the www directory, my slds can then use http://localhost/geoserver/www/symbols/airport.svg as the URL.

Happy to accept a better answer though.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.