[Geoserver-devel] [jira] Created: (GEOS-874) GetMap requests specifying SLD=url in place of LAYERS= and STYLES= don't work.

GetMap requests specifying SLD=url in place of LAYERS= and STYLES= don't work.
------------------------------------------------------------------------------

                 Key: GEOS-874
                 URL: http://jira.codehaus.org/browse/GEOS-874
             Project: GeoServer
          Issue Type: Bug
          Components: WMS
    Affects Versions: 1.4.0
         Environment: CentOS 4, Tomcat 5.5.17, Java 1.5.0
            Reporter: Corey Puffalt
         Assigned To: Gabriel Roldán
            Priority: Critical
             Fix For: 1.4.1

I just upgraded to GeoServer v1.4.0 in order to take advantage of the new layer-group option. Once I used the admin interface to define a layer-group though, an existing map broke.

The problem is that the code in org.vfny.geoserver.wms.requests.GetMapKvpReader.filterBaseMap() is assuming that LAYERS is *always* specified in a GetMap request. This is an incorrect assumption as per the WMS spec the following request is allowed:

http://localhost/geoserver/wms?SLD=file:/path/to/file.sld&STYLES=&FORMAT=image/gif&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&EXCEPTIONS=application/vnd.ogc.se_inimage&SRS=EPSG:4326&BBOX=-324,198,-180,342&WIDTH=256&HEIGHT=256

but due to this bug the map isn't generated. Note that the above request works fine under geoserver v1.3.2 and it also works fine under v1.4.0 as long as no layer-groups are defined!

Here's the relevant stacktrace:

7988624 [INFO] org.vfny.geoserver.servlets.AbstractService - Had an undefined error: null
org.vfny.geoserver.wms.WmsException
        at org.vfny.geoserver.wms.WmsExceptionHandler.newServiceException(WmsExceptionHandler.java:64)
        at org.vfny.geoserver.servlets.AbstractService.sendError(AbstractService.java:881)
        at org.vfny.geoserver.servlets.AbstractService.doGet(AbstractService.java:328)
        at org.geoserver.request.Dispatcher.dispatch(Dispatcher.java:183)
        at org.geoserver.request.Dispatcher.handleRequestInternal(Dispatcher.java:58)
        at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:139)
        at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:44)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:684)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:625)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:392)
        at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:347)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:122)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.NullPointerException
        at org.vfny.geoserver.wms.requests.GetMapKvpReader.filterBaseMap(GetMapKvpReader.java:1290)
        at org.vfny.geoserver.wms.servlets.GetMap.getKvpReader(GetMap.java:145)
        at org.vfny.geoserver.servlets.AbstractService.doGet(AbstractService.java:316)
        ... 27 more

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira