RESTConfig "styles" list does not get generated if a style is missing its associated sld file

Description

Trying to access http://localhost:8080/geoserver/rest/styles.html - http://localhost:8080/geoserver/rest/styles.html
in a configuration where a style has the .xml file but misses the associated .sld file results in a 200/OK with a blank page and the following stack trace:

09 set 16:30:28 ERROR /geoserver - Exception intercepted
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at org.geoserver.ows.util.OwsUtils.get(OwsUtils.java:115)
at org.geoserver..format.ReflectiveHTMLFormat$ObjectToMapWrapper$$M$984dbccd.wrap(ReflectiveHTMLFormat.java:283)
at org.geoserver..format.ReflectiveHTMLFormat$ObjectToMapWrapper$$A$984dbccd.wrap(<generated&gt
at org.geoserver..format.ReflectiveHTMLFormat$ObjectToMapWrapper.wrap(ReflectiveHTMLFormat.java:310)
at freemarker.ext.beans.BeanModel.wrap(BeanModel.java:324)
at freemarker.ext.beans.IteratorModel.next(IteratorModel.java:134)
at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:164)
at freemarker.core.Environment.visit(Environment.java:415)
at freemarker.core.IteratorBlock.accept(IteratorBlock.java:102)
at freemarker.core.Environment.visit(Environment.java:208)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:208)
at freemarker.core.Environment.process(Environment.java:188)
at freemarker.template.Template.process(Template.java:237)
at org.restlet.ext.freemarker.TemplateRepresentation.write(TemplateRepresentation.java:112)
at com.noelios.restlet.http.HttpServerCall.writeResponseBody(HttpServerCall.java:342)
at com.noelios.restlet.http.HttpServerCall.sendResponse(HttpServerCall.java:306)
at com.noelios.restlet.ext.servlet.ServletCall.sendResponse(ServletCall.java:306)
at com.noelios.restlet.http.HttpServerConverter.commit(HttpServerConverter.java:90)
at com.noelios.restlet.ext.servlet.ServletConverter.service(ServletConverter.java:130)
at org.geoserver..RESTDispatcher.handleRequestInternal(RESTDispatcher.java:79)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
at org.geoserver..RESTDispatcher.handleRequest(RESTDispatcher.java:50001)
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.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:174)
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.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor81.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.geoserver.ows.util.OwsUtils.get(OwsUtils.java:112)
... 68 more
Caused by: java.io.IOException: No such file: concat.sld
at org.geoserver.catalog.ResourcePool.getStyle(ResourcePool.java:860)
at org.geoserver.catalog.impl.StyleInfoImpl.getStyle(StyleInfoImpl.java:60)
... 72 more

It seems there is a robustness issue in the code setting up the template model, and an error handling issues as the response shoudl contain some kind of exception, not be a blank page.

Environment

None

Status

Assignee

Andrea Aime

Reporter

codehaus

Triage

None

Fix versions

Affects versions

None

Priority

Medium
Configure