I'm running up against an issue getting a NullPointerException
when I enable GeoServer GWC WMS Direct Integration then request a layer using the SLD_BODY
request parameter (e.g. without a LAYERS
param).
This happens regardless of the content of the SLD_BODY
, regardless of which layer is requested in the SLD and even when tile caching is disabled for the layer requested. When I drop the SLD_BODY
in favor of a LAYERS
parameter everything goes back to normal.
As soon as I turn the direct integration off, this issue goes away.
Anybody have any idea what might be going on here? Is SLD_BODY
just not supported when GWC Direct Integration is enabled?
Details are below.
Results in: https://pastebin.com/yCsMPffg
UPDATE
I fully agree with @iant, @nmtoken and @Andrea Aime and using an SLD_BODY
in a cached layer is somewhat backwards. The problem is that even turning off caching wholesale for the layers you want to use an SLD_BODY
it still throws this error. Honestly, a way to tell Geoserver to just process this request as a standard WMS request for this layer would be a perfectly acceptable solution to my immediate problem. However, I can't seem to find a way to do so.
Decoded SLD Request:
<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor version="1.0.0"
xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"
xmlns="http://www.opengis.net/sld"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<NamedLayer>
<Name>cities</Name>
<UserStyle>
<Title>Default Point</Title>
<Abstract>A sample style that draws a point</Abstract>
<FeatureTypeStyle>
<Rule>
<Name>rule1</Name>
<Title>Red Square</Title>
<Abstract>A 6 pixel square with a red fill and no stroke</Abstract>
<PointSymbolizer>
<Graphic>
<Mark>
<WellKnownName>square</WellKnownName>
<Fill>
<CssParameter name="fill">#FF0000</CssParameter>
</Fill>
</Mark>
<Size>6</Size>
</Graphic>
</PointSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>
Relevant Log Exception Excerpt:
java.lang.NullPointerException
at org.geoserver.gwc.GWC.dispatch(GWC.java:668)
at org.geoserver.gwc.wms.CachingWebMapService.invoke(CachingWebMapService.java:84)
at org.geoserver.gwc.wms.CachingWebMapService.invoke(CachingWebMapService.java:55)
Based what I can tell from the stack trace (fully admitting I am neither a Java guy nor a Geoserver expert), when GWC direct integration is enabled, it uses the CachingWebMapService
class which calls GWC.dispatch.ConveyorTile
, this does some checks for a LAYERS
parameter and when there isn't one, it throws.