We're updating the issue view to help you get more done. 

Creation of SQL View Layer with Parameters fails

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 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

Environment

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

Status

Assignee

Andrea Aime

Reporter

Andreas Wagner

Triage

Fix versions

Affects versions

2.11.3
2.12.0

Components

Priority

High