Uploaded image for project: 'GeoServer'
  1. GEOS-8363

Creation of SQL View Layer with Parameters fails

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: 2.11.3, 2.12.0
    • Fix Version/s: 2.11.4, 2.12.1
    • Component/s: Wicket UI
    • Labels:
      None
    • Environment:

      clean geoserver with test files included, no external data directory
      added workspace & Postgis Datasource

      Description

      Problem description
      Starting with Geoserver 2.11.3 the options "Guess Parameters from SQL" and "Add new Parameter" in an SQL View are failing with an exception shown below.

      Workflow to reproduce the issue:

      • clean Geoserver installation (War in Tomcat), no external data directory set
      • added new workspace (checked as default workspace)
      • added new POSTGIS DataSource
      • create SQL View
      • click "Add new Parameter" or define SQL with %PARAMNAME% Placeholder and click "Guess Parameters from SQL"

      Sidenotes

      • Same Workflow works in versions before 2.11.3.
      • Once the view is created (e.g. use an older version of Geoserver to create the view and the upgrade geoserver) it can be rendered by the afflicted versions. So it seams its just a problem during creation in the UI.

      Exception

      org.apache.wicket.WicketRuntimeException: Exception in rendering component: [WebMarkupContainer [Component id = selectItemContainer]]
      	at org.apache.wicket.Component.internalRenderComponent(Component.java:2625)
      	at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1668)
      	at org.apache.wicket.Component.internalRender(Component.java:2401)
      	at org.apache.wicket.Component.render(Component.java:2329)
      	at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1526)
      	at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1729)
      	at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1704)
      	at org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1659)
      	at org.apache.wicket.markup.html.panel.DefaultMarkupSourcingStrategy.onComponentTagBody(DefaultMarkupSourcingStrategy.java:70)
      	at org.apache.wicket.Component.internalRenderComponent(Component.java:2601)
      	at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1668)
      	at org.apache.wicket.Component.internalRender(Component.java:2401)
      	at org.apache.wicket.Component.render(Component.java:2329)
      	at org.apache.wicket.markup.repeater.AbstractRepeater.renderChild(AbstractRepeater.java:115)
      	at org.apache.wicket.markup.repeater.AbstractRepeater.onRender(AbstractRepeater.java:102)
      	at org.apache.wicket.Component.internalRender(Component.java:2401)
      	at org.apache.wicket.Component.render(Component.java:2329)
      	at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1526)
      	at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1729)
      	at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1704)
      	at org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1659)
      	at org.apache.wicket.markup.html.panel.DefaultMarkupSourcingStrategy.onComponentTagBody(DefaultMarkupSourcingStrategy.java:70)
      	at org.apache.wicket.Component.internalRenderComponent(Component.java:2601)
      	at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1668)
      	at org.apache.wicket.Component.internalRender(Component.java:2401)
      	at org.apache.wicket.Component.render(Component.java:2329)
      	at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1526)
      	at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1729)
      	at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1704)
      	at org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:799)
      	at org.apache.wicket.markup.html.panel.AssociatedMarkupSourcingStrategy.renderAssociatedMarkup(AssociatedMarkupSourcingStrategy.java:77)
      	at org.apache.wicket.markup.html.panel.PanelMarkupSourcingStrategy.onComponentTagBody(PanelMarkupSourcingStrategy.java:112)
      	at org.apache.wicket.Component.internalRenderComponent(Component.java:2601)
      	at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1668)
      	at org.apache.wicket.Component.internalRender(Component.java:2401)
      	at org.apache.wicket.Component.render(Component.java:2329)
      	at org.apache.wicket.page.XmlPartialPageUpdate.writeComponent(XmlPartialPageUpdate.java:119)
      	at org.apache.wicket.page.PartialPageUpdate.writeComponents(PartialPageUpdate.java:248)
      	at org.apache.wicket.page.PartialPageUpdate.writeTo(PartialPageUpdate.java:161)
      	at org.apache.wicket.ajax.AjaxRequestHandler.respond(AjaxRequestHandler.java:358)
      	at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:895)
      	at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
      	at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:97)
      	at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:265)
      	at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:222)
      	at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:293)
      	at org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:261)
      	at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:203)
      	at org.apache.wicket.protocol.http.WicketServlet.doPost(WicketServlet.java:159)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
      	at org.springframework.web.servlet.mvc.ServletWrappingController.handleRequestInternal(ServletWrappingController.java:158)
      	at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:147)
      	at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:50)
      	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
      	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
      	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:968)
      	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:870)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
      	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:844)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.geoserver.filters.ThreadLocalsCleanupFilter.doFilter(ThreadLocalsCleanupFilter.java:28)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:75)
      	at org.geoserver.wms.animate.AnimatorFilter.doFilter(AnimatorFilter.java:71)
      	at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:71)
      	at org.geoserver.filters.SpringDelegatingFilter.doFilter(SpringDelegatingFilter.java:46)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.geoserver.platform.AdvancedDispatchFilter.doFilter(AdvancedDispatchFilter.java:50)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:316)
      	at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69)
      	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:126)
      	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:90)
      	at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73)
      	at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
      	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
      	at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69)
      	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114)
      	at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73)
      	at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
      	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
      	at org.geoserver.security.filter.GeoServerAnonymousAuthenticationFilter.doFilter(GeoServerAnonymousAuthenticationFilter.java:54)
      	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
      	at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69)
      	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:205)
      	at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73)
      	at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
      	at org.geoserver.security.filter.GeoServerUserNamePasswordAuthenticationFilter.doFilter(GeoServerUserNamePasswordAuthenticationFilter.java:116)
      	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
      	at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69)
      	at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:157)
      	at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73)
      	at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
      	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
      	at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69)
      	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:91)
      	at org.geoserver.security.filter.GeoServerSecurityContextPersistenceFilter$1.doFilter(GeoServerSecurityContextPersistenceFilter.java:53)
      	at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73)
      	at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
      	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
      	at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:213)
      	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:176)
      	at org.geoserver.security.GeoServerSecurityFilterChainProxy.doFilter(GeoServerSecurityFilterChainProxy.java:152)
      	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
      	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:88)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.geoserver.filters.XFrameOptionsFilter.doFilter(XFrameOptionsFilter.java:89)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:42)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.geoserver.filters.SessionDebugFilter.doFilter(SessionDebugFilter.java:48)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.geoserver.filters.FlushSafeFilter.doFilter(FlushSafeFilter.java:44)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121)
      	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
      	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
      	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
      	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
      	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
      	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
      	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
      	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.RuntimeException: An error occurred while getting the model object for Component: [CheckBox [Component id = selectItem, page = org.geoserver.web.data.layer.SQLViewNewPage, path = form:parameters:listContainer:items:1:selectItemContainer:selectItem, type = org.apache.wicket.markup.html.form.CheckBox, isVisible = true, isVersioned = false, markup = [markup = jar:file:/development/servers/graphium-apache-tomcat-8.5.23/webapps/geoserver/WEB-INF/lib/gs-web-core-2.11.3.jar!/org/geoserver/web/wicket/GeoServerTablePanel.html
      <input type="checkbox" wicket:id="selectItem"/>, index = 0, current =  '<input type="checkbox" wicket:id="selectItem"/>' (line 0, column 0)]]]
      	at org.apache.wicket.Component.getDefaultModelObject(Component.java:1651)
      	at org.apache.wicket.Component.getDefaultModelObjectAsString(Component.java:1674)
      	at org.apache.wicket.markup.html.form.FormComponent.getModelValue(FormComponent.java:1287)
      	at org.apache.wicket.markup.html.form.FormComponent.getValue(FormComponent.java:871)
      	at org.apache.wicket.markup.html.form.CheckBox.onComponentTag(CheckBox.java:144)
      	at org.apache.wicket.Component.internalRenderComponent(Component.java:2542)
      	at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1668)
      	at org.apache.wicket.Component.internalRender(Component.java:2401)
      	at org.apache.wicket.Component.render(Component.java:2329)
      	at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1526)
      	at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1729)
      	at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1704)
      	at org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1659)
      	at org.apache.wicket.markup.html.panel.DefaultMarkupSourcingStrategy.onComponentTagBody(DefaultMarkupSourcingStrategy.java:70)
      	at org.apache.wicket.Component.internalRenderComponent(Component.java:2601)
      	... 151 more
      Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
      	at org.geoserver.web.wicket.GeoServerTablePanel$SelectionModel.getObject(GeoServerTablePanel.java:698)
      	at org.geoserver.web.wicket.GeoServerTablePanel$SelectionModel.getObject(GeoServerTablePanel.java:689)
      	at org.apache.wicket.Component.getDefaultModelObject(Component.java:1646)
      	... 165 more
      

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                aaime Andrea Aime
                Reporter:
                andreas.wagner Andreas Wagner
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: