[Geoserver-devel] [jira] (GEOS-5846) GetLegendGraphic outside scale threshold triggers ERROR lvl event

Jonathan Moules created BugGEOS-5846
GetLegendGraphic outside scale threshold triggers ERROR lvl event

Issue Type:

BugBug

Affects Versions:

2.3.2

Assignee:

Andrea Aime

Components:

WMS

Created:

12/Jun/13 5:09 AM

Description:

When I send a GetLegendGraphic request to GeoServer for a layer that’s outside of the scalethreshold specified in its SLD, GeoServer returns the below.

I appreciate it shouldn’t return a legend (although the spec doesn’t seem to explicitly say that), but should there really be a java exception in there?

<?xml version=“1.0” encoding=“UTF-8” standalone=“no”?><!DOCTYPE ServiceExceptionReport SYSTEM “http://wppgeog3:8082/geoserver/schemas/wms/1.1.1/WMS_exception_1_1_1.dtd”> <ServiceExceptionReport version=“1.1.1” > <ServiceException>
java.lang.IllegalArgumentException: no legend passed
no legend passed
</ServiceException></ServiceExceptionReport>

It even triggers ERROR level events in the log!

2013-06-12 10:01:47,793 ERROR [geoserver.ows] -
java.lang.IllegalArgumentException: no legend passed
at org.geoserver.wms.legendgraphic.BufferedImageLegendGraphicBuilder.buildLegendGraphic(BufferedImageLegendGraphicBuilder.java:410)
at org.geoserver.wms.legendgraphic.PNGLegendOutputFormat.produceLegendGraphic(PNGLegendOutputFormat.java:40)
at org.geoserver.wms.legendgraphic.PNGLegendOutputFormat.produceLegendGraphic(PNGLegendOutputFormat.java:21)
at org.geoserver.wms.GetLegendGraphic.run(GetLegendGraphic.java:48)
at org.geoserver.wms.DefaultWebMapService.getLegendGraphic(DefaultWebMapService.java:385)
at sun.reflect.GeneratedMethodAccessor291.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.geoserver.ows.util.RequestObjectLogger.invoke(RequestObjectLogger.java:32)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at com.sun.proxy.$Proxy25.getLegendGraphic(Unknown Source)
at sun.reflect.GeneratedMethodAccessor278.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.geoserver.ows.Dispatcher.execute(Dispatcher.java:774)

The SLD spec doesn’t seem to say exactly what should happen.
Ideally the exception message would probably be a more descriptive:
“No legend at this scale.”

Project:

GeoServer

Priority:

MinorMinor

Reporter:

Jonathan Moules

This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: [http://www.atlassian.com/software/jira](http://www.atlassian.com/software/jira)