Description
I started to use #queue instead of TransparentWebMarkupContainer as suggested in WICKET-5898, to my surprise #replace does not work for queued components (it is a feature, right?) :
org.apache.wicket.WicketRuntimeException: Cannot replace a component which has not been added: id='PANEL', component=[EmptyPanel [Component id = PANEL]]: [Page class = krasa.wicket.npe.BrokenPage, id = 0, render count = 1] at org.apache.wicket.MarkupContainer.replace(MarkupContainer.java:736) ~[wicket-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] at krasa.wicket.npe.BrokenPage$1.onSubmit(BrokenPage.java:24) ~[classes/:?] at org.apache.wicket.ajax.markup.html.form.AjaxButton$1.onSubmit(AjaxButton.java:111) ~[wicket-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] at org.apache.wicket.ajax.form.AjaxFormSubmitBehavior$AjaxFormSubmitter.onSubmit(AjaxFormSubmitBehavior.java:215) ~[wicket-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] at org.apache.wicket.markup.html.form.Form.delegateSubmit(Form.java:1307) ~[wicket-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] at org.apache.wicket.markup.html.form.Form.process(Form.java:974) ~[wicket-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:795) ~[wicket-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] at org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:171) ~[wicket-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:156) ~[wicket-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:581) ~[wicket-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_72] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_72] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_72] at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_72] at org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:258) ~[wicket-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:241) ~[wicket-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:248) ~[wicket-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:234) ~[wicket-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:865) ~[wicket-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64) ~[wicket-request-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:265) [wicket-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:222) [wicket-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:293) [wicket-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] at org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:261) [wicket-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:203) [wicket-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:284) [wicket-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) [jetty-servlet-9.2.10.v20150310.jar:9.2.10.v20150310] at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585) [jetty-servlet-9.2.10.v20150310.jar:9.2.10.v20150310] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [jetty-server-9.2.10.v20150310.jar:9.2.10.v20150310] at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577) [jetty-security-9.2.10.v20150310.jar:9.2.10.v20150310] at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223) [jetty-server-9.2.10.v20150310.jar:9.2.10.v20150310] at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127) [jetty-server-9.2.10.v20150310.jar:9.2.10.v20150310] at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515) [jetty-servlet-9.2.10.v20150310.jar:9.2.10.v20150310] at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) [jetty-server-9.2.10.v20150310.jar:9.2.10.v20150310] at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061) [jetty-server-9.2.10.v20150310.jar:9.2.10.v20150310] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [jetty-server-9.2.10.v20150310.jar:9.2.10.v20150310] at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) [jetty-server-9.2.10.v20150310.jar:9.2.10.v20150310] at org.eclipse.jetty.server.Server.handle(Server.java:497) [jetty-server-9.2.10.v20150310.jar:9.2.10.v20150310] at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310) [jetty-server-9.2.10.v20150310.jar:9.2.10.v20150310] at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257) [jetty-server-9.2.10.v20150310.jar:9.2.10.v20150310] at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540) [jetty-io-9.2.10.v20150310.jar:9.2.10.v20150310] at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635) [jetty-util-9.2.10.v20150310.jar:9.2.10.v20150310] at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555) [jetty-util-9.2.10.v20150310.jar:9.2.10.v20150310] at java.lang.Thread.run(Thread.java:745) [?:1.7.0_72]
When I click on back button, it will give me an NPE:
java.lang.NullPointerException at org.apache.wicket.Page.hasInvisibleTransparentChild(Page.java:679) ~[wicket-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] at org.apache.wicket.Page.checkRendering(Page.java:645) ~[wicket-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] at org.apache.wicket.Page.onAfterRender(Page.java:821) ~[wicket-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] at org.apache.wicket.markup.html.WebPage.onAfterRender(WebPage.java:216) ~[wicket-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] at org.apache.wicket.Component.afterRender(Component.java:918) ~[wicket-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] at org.apache.wicket.Component.render(Component.java:2319) ~[wicket-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] at org.apache.wicket.Page.renderPage(Page.java:1018) ~[wicket-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] at org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:124) ~[wicket-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:195) ~[wicket-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] at org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:175) ~[wicket-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:865) ~[wicket-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64) ~[wicket-request-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:265) [wicket-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:222) [wicket-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:293) [wicket-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] at org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:261) [wicket-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:203) [wicket-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:284) [wicket-core-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT] at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) [jetty-servlet-9.2.10.v20150310.jar:9.2.10.v20150310] at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585) [jetty-servlet-9.2.10.v20150310.jar:9.2.10.v20150310] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [jetty-server-9.2.10.v20150310.jar:9.2.10.v20150310] at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577) [jetty-security-9.2.10.v20150310.jar:9.2.10.v20150310] at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223) [jetty-server-9.2.10.v20150310.jar:9.2.10.v20150310] at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127) [jetty-server-9.2.10.v20150310.jar:9.2.10.v20150310] at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515) [jetty-servlet-9.2.10.v20150310.jar:9.2.10.v20150310] at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) [jetty-server-9.2.10.v20150310.jar:9.2.10.v20150310] at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061) [jetty-server-9.2.10.v20150310.jar:9.2.10.v20150310] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [jetty-server-9.2.10.v20150310.jar:9.2.10.v20150310] at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) [jetty-server-9.2.10.v20150310.jar:9.2.10.v20150310] at org.eclipse.jetty.server.Server.handle(Server.java:497) [jetty-server-9.2.10.v20150310.jar:9.2.10.v20150310] at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310) [jetty-server-9.2.10.v20150310.jar:9.2.10.v20150310] at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257) [jetty-server-9.2.10.v20150310.jar:9.2.10.v20150310] at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540) [jetty-io-9.2.10.v20150310.jar:9.2.10.v20150310] at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635) [jetty-util-9.2.10.v20150310.jar:9.2.10.v20150310] at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555) [jetty-util-9.2.10.v20150310.jar:9.2.10.v20150310] at java.lang.Thread.run(Thread.java:745) [?:1.7.0_72]
(both in 7.0.0-M5 and current master)
quickstart: https://github.com/krasa/wicket-bugs
-Start
-open http://localhost:8080/
-click on the button
-click Back