While creating a quickstart for the jira issue, I noticed that it only occurs when using custom error pages as described on http://cwiki.apache.org/WICKET/error-pages-and-feedback-messages.html ... so maybe jetty creates a new (internal) web request and the application gets detached before the "old" request can be cleaned up properly. as far as i could see the getApplication method is only needed for checking if the app is in development mode and does some additional cleanup if it is ... anyway, the issue can be found on https://issues.apache.org/jira/browse/WICKET-1478
regards, Michael igor.vaynberg wrote: > > jira... > > -igor > > On Wed, Apr 2, 2008 at 2:41 AM, Michael Sparer <[EMAIL PROTECTED]> > wrote: >> >> (Using wicket 1.3.2) I have a super class (WebPage) that throws a >> AbortWithWebErrorCodeException(404) depending on some properties of its >> subclasses. Therefore I can't check the subclasses' properties in the >> super >> class' constructor and throw the exception there. >> So I tried to throw it in the onBeforeRender method instead. The Error >> page >> for the 404 gets rendered and displayed without problems however an >> exception gets thrown (see below). >> >> So my question: where's the (right) place to throw the exception? I also >> tried RequestCycle.get().setRequestTarget(new >> WebErrorCodeResponseTarget(404)); with the same result. >> >> thanks in advance >> >> michael >> >> exception trace: >> ERROR - RequestCycle - there was an error cleaning up >> target >> [EMAIL PROTECTED] pageClass=XXXXXXXX]. >> org.apache.wicket.WicketRuntimeException: There is no application >> attached >> to current thread btpool0-2 >> at org.apache.wicket.Application.get(Application.java:166) >> at >> org.apache.wicket.Component.getApplication(Component.java:1229) >> at >> org.apache.wicket.markup.html.WebPage.onDetach(WebPage.java:404) >> at org.apache.wicket.Component.detach(Component.java:1075) >> at >> >> org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.detach(BookmarkablePageRequestTarget.java:122) >> at org.apache.wicket.RequestCycle.detach(RequestCycle.java:1046) >> at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1348) >> at org.apache.wicket.RequestCycle.request(RequestCycle.java:493) >> at >> >> org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:358) >> at >> >> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194) >> at >> >> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065) >> at >> >> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) >> at >> >> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75) >> at >> >> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065) >> >> ----- >> Michael Sparer >> http://talk-on-tech.blogspot.com >> -- >> View this message in context: >> http://www.nabble.com/Throw-AbortWithWebErrorCodeException-in-onBeforeRender-tp16446341p16446341.html >> Sent from the Wicket - User mailing list archive at Nabble.com. >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > ----- Michael Sparer http://talk-on-tech.blogspot.com -- View this message in context: http://www.nabble.com/Throw-AbortWithWebErrorCodeException-in-onBeforeRender-tp16446341p16487488.html Sent from the Wicket - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
