meggsimum ( 
https://osgeo-org.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A0ae45b0b-864b-478f-b858-f375cf1fa9bd
 ) *created* an issue

GeoServer ( 
https://osgeo-org.atlassian.net/browse/GEOS?atlOrigin=eyJpIjoiYzE3NmIwNTNmNmE3NGE4ODhiNzlkYzM2MGI0NThhMjgiLCJwIjoiaiJ9
 ) / Bug ( 
https://osgeo-org.atlassian.net/browse/GEOS-10220?atlOrigin=eyJpIjoiYzE3NmIwNTNmNmE3NGE4ODhiNzlkYzM2MGI0NThhMjgiLCJwIjoiaiJ9
 ) GEOS-10220 ( 
https://osgeo-org.atlassian.net/browse/GEOS-10220?atlOrigin=eyJpIjoiYzE3NmIwNTNmNmE3NGE4ODhiNzlkYzM2MGI0NThhMjgiLCJwIjoiaiJ9
 ) Publish SLD with InlineContent via REST API fails ( 
https://osgeo-org.atlassian.net/browse/GEOS-10220?atlOrigin=eyJpIjoiYzE3NmIwNTNmNmE3NGE4ODhiNzlkYzM2MGI0NThhMjgiLCJwIjoiaiJ9
 )

Issue Type: Bug Affects Versions: 2.19.1, 2.19.2 Assignee: Unassigned 
Components: REST Created: 31/Aug/21 1:49 PM Priority: Medium Reporter: 
meggsimum ( 
https://osgeo-org.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A0ae45b0b-864b-478f-b858-f375cf1fa9bd
 )

Using the GeoServer REST-API to publish a SLD with InlineContent (e.g. a base64 
png image) fails.
The request fails with the message an HTTP 500 "Error writing style".

The REST call works quite well with a "normal" SLD, such as the simple "point" 
example. So the problem seems to be related to the InlineContent element. When 
publishing the SLD with the InlineContent element via GeoServer web GUI it 
works without any issues and even the validator says "No validation errors.".

Here a cURL for an example of such a failing REST API call:

 {{ curl -X POST \

'http://localhost:8080/geoserver/rest/workspaces/test-cm/styles?name=foo' \
-H 'Authorization: Basic YWRtaW46Z2Vvc2VydmVy' \
-H 'Content-Type: application/vnd.ogc.sld+xml' \
-H 'cache-control: no-cache' \
-d '<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor
xmlns:xsi='\''http://www.w3.org/2001/XMLSchema-instance'\''
xmlns="http://www.opengis.net/sld";
xmlns:sld="http://www.opengis.net/sld";
xmlns:se="http://www.opengis.net/se";
xsi:schemaLocation="http://www.opengis.net/sld
http://schemas.opengis.net/sld/1.1.0/StyledLayerDescriptor.xsd
http://www.opengis.net/se
http://schemas.opengis.net/se/1.1.0/FeatureStyle.xsd "
version="1.1.0"
>
<UserLayer>
<se:Name>sauber_stations</se:Name>
<UserStyle>
<se:FeatureTypeStyle>
<se:Rule>
<se:Name>sauber_stations_rule_1</se:Name>
<se:PointSymbolizer>
<se:Graphic>
<se:ExternalGraphic>
<se:InlineContent
encoding="base64">iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAABgAAAAYADwa0LPAAABhklEQVRYw+3XMUscURAH8J854QJ2EUzSpZWENCcqGNATvC9gII3kI5jS9iy1EPEz2PgVDCQpDBgSGxtBC0vBMiGaI4ak2HfccZ7Hure7d4H9w8C8eftm/m/mveEtBQr0h5GM/E6igokwvsQRTvLcXBnvcIa/d8gZVsO3mWZoGnt4hl/4gI+4CPNPUcUiHuIcb/A1i8zM4Bq/saVVJigFaeIxtsO3V2Ft6ihhB/Nh/ASbOMVNkFNsBEKwENaU7hMoCV7jh+i8fMchvgS9aVvu5eBByoSei8q3gnHMisoyjrdo4EXWWenEo4Rzw4msGiO8wlzQP+Ng0JutazXEetxFaR/qvlEQ+u8IjfaYq+Gl5O19rkNfC/ofHGP/Ps523f2ESEt245Kp5UCmKUudwbudoUrCEiXBVBxC5RiO0sKtWHFv2UibNFFts30KtvU223oShkN37YeOUDfU5XfL6nEy1Mhx87didSP0LUdCsWMNrFP3ejEuiR7pYyln5afob+R9yn4LFAD/AABxpFl+H1QlAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIxLTA4LTI2VDA4OjMzOjMwKzAwOjAwM+HvGAAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMS0wOC0yNlQwODozMzozMCswMDowMEK8V6QAAAAASUVORK5CYII=</se:InlineContent>
<se:Format>image/png</se:Format>
</se:ExternalGraphic>
</se:Graphic>
</se:PointSymbolizer>
</se:Rule>
</se:FeatureTypeStyle>
</UserStyle>
</UserLayer>
</StyledLayerDescriptor>' }} 

The logfiles states the follwong error:

 {{ ERROR [geoserver.rest] - Error writing style
org.geoserver.rest.RestException 500 INTERNAL_SERVER_ERROR: Error writing style
at 
org.geoserver.rest.catalog.StyleController.styleSLDPost(StyleController.java:242)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at 
org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:207)
at 
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
at 
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)
at 
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
at 
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:800)
at 
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at 
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1038)
at 
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942)
at 
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:998)
at 
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:901)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:660) }} 

The problem was initially posted to the Users Mailing List: 
https://sourceforge.net/p/geoserver/mailman/message/37341643/

( 
https://osgeo-org.atlassian.net/browse/GEOS-10220#add-comment?atlOrigin=eyJpIjoiYzE3NmIwNTNmNmE3NGE4ODhiNzlkYzM2MGI0NThhMjgiLCJwIjoiaiJ9
 ) Add Comment ( 
https://osgeo-org.atlassian.net/browse/GEOS-10220#add-comment?atlOrigin=eyJpIjoiYzE3NmIwNTNmNmE3NGE4ODhiNzlkYzM2MGI0NThhMjgiLCJwIjoiaiJ9
 )

Get Jira notifications on your phone! Download the Jira Cloud app for Android ( 
https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail
 ) or iOS ( 
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8
 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100175- 
sha1:92848a8 )
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to