GeoServer
  1. GeoServer
  2. GEOS-3394

Missing SLD causes NPE in Style Editor

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-RC1
    • Fix Version/s: 2.0-RC2
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      If styles/foo.xml exists but styles/foo.sld does not, then trying to edit or delete the style configuration through the Wicket UI results in an NPE.

        Activity

        Hide
        Andrea Aime added a comment -

        Interesting one... wondering what we should do in this case. Drop the style config and tell the user the style is gone? Or let him edit from an emtpy sheet and provide some warning?
        Probably the latter, the style could be associated to some layer.

        Show
        Andrea Aime added a comment - Interesting one... wondering what we should do in this case. Drop the style config and tell the user the style is gone? Or let him edit from an emtpy sheet and provide some warning? Probably the latter, the style could be associated to some layer.
        Hide
        Andrea Aime added a comment -

        Tried this out, deleted the .sld file, but got a different exception:

        28 ago 13:14:34 ERROR [wicket.RequestCycle] - java.io.IOException: No such file: Lakes.sld
        org.apache.wicket.WicketRuntimeException: java.io.IOException: No such file: Lakes.sld
        	at org.geoserver.wms.web.data.AbstractStylePage.<init>(AbstractStylePage.java:99)
        	at org.geoserver.wms.web.data.StyleEditPage.<init>(StyleEditPage.java:20)
        	at org.geoserver.wms.web.data.StylePage$3.onClick(StylePage.java:97)
        	at org.geoserver.web.wicket.SimpleAjaxLink$1.onClick(SimpleAjaxLink.java:44)
        	at org.apache.wicket.ajax.markup.html.AjaxLink$1.onEvent(AjaxLink.java:65)
        	at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:163)
        	at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:297)
        	at org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:104)
        	at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:91)
        	at org.geoserver.web.GeoServerApplication$RequestCycleProcessor.processEvents(GeoServerApplication.java:50001)
        	at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1220)
        	at org.apache.wicket.RequestCycle.step(RequestCycle.java:1297)
        	at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1399)
        	at org.apache.wicket.RequestCycle.request(RequestCycle.java:529)
        	at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:356)
        	at org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:124)
        	at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
        	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        	at org.springframework.web.servlet.mvc.ServletWrappingController.handleRequestInternal(ServletWrappingController.java:158)
        	at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
        	at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
        	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
        	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
        	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
        	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501)
        	at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
        	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
        	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
        	at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
        	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
        	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
        	at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
        	at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
        	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
        	at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:124)
        	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
        	at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
        	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
        	at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
        	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
        	at org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
        	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
        	at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
        	at org.geoserver.security.GeoserverAuthenticationProcessingFilter.doFilter(GeoserverAuthenticationProcessingFilter.java:50001)
        	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
        	at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
        	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
        	at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
        	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
        	at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
        	at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
        	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
        	at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:73)
        	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
        	at org.geoserver.filters.ReverseProxyFilter.doFilter(ReverseProxyFilter.java:183)
        	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
        	at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:41)
        	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
        	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
        	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
        	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
        	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)
        	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
        	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
        	at org.mortbay.jetty.Server.handle(Server.java:324)
        	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
        	at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:828)
        	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
        	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
        	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
        	at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
        	at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)
        Caused by: java.io.IOException: No such file: Lakes.sld
        	at org.geoserver.catalog.ResourcePool.readStyle(ResourcePool.java:885)
        	at org.geoserver.wms.web.data.AbstractStylePage.readFile(AbstractStylePage.java:259)
        	at org.geoserver.wms.web.data.AbstractStylePage.<init>(AbstractStylePage.java:97)
        	... 72 more
        
        Show
        Andrea Aime added a comment - Tried this out, deleted the .sld file, but got a different exception: 28 ago 13:14:34 ERROR [wicket.RequestCycle] - java.io.IOException: No such file: Lakes.sld org.apache.wicket.WicketRuntimeException: java.io.IOException: No such file: Lakes.sld at org.geoserver.wms.web.data.AbstractStylePage.<init>(AbstractStylePage.java:99) at org.geoserver.wms.web.data.StyleEditPage.<init>(StyleEditPage.java:20) at org.geoserver.wms.web.data.StylePage$3.onClick(StylePage.java:97) at org.geoserver.web.wicket.SimpleAjaxLink$1.onClick(SimpleAjaxLink.java:44) at org.apache.wicket.ajax.markup.html.AjaxLink$1.onEvent(AjaxLink.java:65) at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:163) at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:297) at org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:104) at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:91) at org.geoserver.web.GeoServerApplication$RequestCycleProcessor.processEvents(GeoServerApplication.java:50001) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1220) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1297) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1399) at org.apache.wicket.RequestCycle.request(RequestCycle.java:529) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:356) at org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:124) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.springframework.web.servlet.mvc.ServletWrappingController.handleRequestInternal(ServletWrappingController.java:158) at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153) at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093) at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265) at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107) at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:124) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271) at org.geoserver.security.GeoserverAuthenticationProcessingFilter.doFilter(GeoserverAuthenticationProcessingFilter.java:50001) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:110) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149) at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:73) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) at org.geoserver.filters.ReverseProxyFilter.doFilter(ReverseProxyFilter.java:183) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:41) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:324) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:828) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380) at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228) at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450) Caused by: java.io.IOException: No such file: Lakes.sld at org.geoserver.catalog.ResourcePool.readStyle(ResourcePool.java:885) at org.geoserver.wms.web.data.AbstractStylePage.readFile(AbstractStylePage.java:259) at org.geoserver.wms.web.data.AbstractStylePage.<init>(AbstractStylePage.java:97) ... 72 more
        Hide
        Andrea Aime added a comment -

        Hopefully fixed on trunk. A message now tells the user the sld file could not be found.
        Of course in such situation all WMS request will fail miserably unless the file is deleted after the Style object has been cached in memory (and only as long as it stays cached)

        Show
        Andrea Aime added a comment - Hopefully fixed on trunk. A message now tells the user the sld file could not be found. Of course in such situation all WMS request will fail miserably unless the file is deleted after the Style object has been cached in memory (and only as long as it stays cached)

          People

          • Assignee:
            Andrea Aime
            Reporter:
            David Winslow
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: