You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by sstefanov <st...@gmail.com> on 2015/02/11 09:42:41 UTC

Random 'Component not found' error

Hello,

I have a strange error 'Component not found', which occurs only when a save
operation to DB takes some time to complete. If the operation executes fast
the error is not generated. What is even more strange is that for the same
test case executed on local machine the error is generated and on the
development server it's not, for another test case it's the opposite. What
is the reason for such strange behaviour ? Thanks!

Here is the stack trace :

ERROR - org.apache.wicket.DefaultExceptionMapper 123 - Unexpected error
occurred
org.apache.wicket.core.request.handler.ComponentNotFoundException: Could not
find component
'form:saveContainer:saveRepeater:1:lightboxWrapper:lightbox:content:confirm'
on page 'class
com.honda.eu.unitsalesregistration.web.pages.registration.UnitSalesPage
	at
org.apache.wicket.core.request.handler.PageAndComponentProvider.getComponent(PageAndComponentProvider.java:182)
	at
org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.getComponent(ListenerInterfaceRequestHandler.java:90)
	at
org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:231)
	at
org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:840)
	at
org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
	at
org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:254)
	at
org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:211)
	at
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:282)
	at
org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:244)
	at
org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
	at
org.apache.wicket.protocol.http.WicketServlet.doPost(WicketServlet.java:159)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
	at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
	at
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
	at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
	at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368)
	at
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
	at
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
	at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
	at
org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
	at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
	at
org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100)
	at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
	at
org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78)
	at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
	at
org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
	at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
	at
org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35)
	at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
	at
org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:177)
	at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
	at
org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter.doFilter(DefaultLoginPageGeneratingFilter.java:91)
	at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
	at
org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187)
	at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
	at
com.honda.eu.framework.security.panex.PanexAuthenticatedProcessingFilter.doFilter(PanexAuthenticatedProcessingFilter.java:89)
	at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
	at
org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
	at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
	at
org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
	at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
	at
org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169)
	at
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
	at
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
	at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
	at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:440)
	at
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
	at
org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
	at org.mortbay.jetty.Server.handle(Server.java:326)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
	at
org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:943)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
	at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
	at
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Random-Component-not-found-error-tp4669449.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Random 'Component not found' error

Posted by sstefanov <st...@gmail.com>.
Sure a veil is displayed on the page. Also on button Confirm, Cancel and hide
of the veil the following is executed, which could be a reason for the error
:

saveRepeater.removeAll();

I'm trying to find a solution with hiding the content instead of removing
it, but it's not working at the moment.

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Random-Component-not-found-error-tp4669449p4669455.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Random 'Component not found' error

Posted by Martin Grigorov <mg...@apache.org>.
I guess you need a veil to be shown on the page (or at least over
"saveContainer") while this operation runs, so no other Ajax calls are
scheduled.
You are adding new items to the "saveRepeater" and then repaint the whole
"saveContainer" and there i a chance that some link/button becomes stale
after this.

Check this article too:
http://wicketinaction.com/2008/10/repainting-only-newly-created-repeater-items-via-ajax/

On Wed, Feb 11, 2015 at 11:10 AM, sstefanov <st...@gmail.com>
wrote:

> Здравей :)
>
> thanks for the quick response !
>
> In this case I guess a button which is added on button save click causes
> the
> problem. Here is the code :
>
> final WebMarkupContainer saveContainer = addComponent(form,
> withMarkupId(new
> WebMarkupContainer("saveContainer")));
> saveContainer.setOutputMarkupId(true);
> final RepeatingView saveRepeater = addComponent(saveContainer, new
> RepeatingView("saveRepeater"));
>
>
>                 table.add(new AjaxButton("save") {
>
>                         @Override
>                         protected void onSubmit(AjaxRequestTarget target,
> Form<?> form) {
>
>                                 Fragment content = new Fragment("content",
> "fragment", saveContainer);
>
>                                 content.add(new AjaxButton("confirm") {
>
>                                         @Override
>                                         protected void
> onSubmit(AjaxRequestTarget target, Form<?> form) {
>                                                 ...
>                                         }
>                                 });
>
>                                 content.add(new Button("cancel").add(new
> AjaxEventBehavior("onclick") {
>
>                                         @Override
>                                         protected void
> onEvent(AjaxRequestTarget target) {
>                                                 ...
>                                         }
>
>                                 }));
>
>                                 saveRepeater.add(new
> Lightbox(saveRepeater.newChildId(), content, new
> CloseHandler() {
>
>                                         @Override
>                                         public void
> onClose(AjaxRequestTarget target) {
>                                                 ...
>
>                                         }
>                                 }));
>
>                                 target.add(saveContainer);
>                         }
>
>                 });
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Random-Component-not-found-error-tp4669449p4669453.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Random 'Component not found' error

Posted by sstefanov <st...@gmail.com>.
Здравей :)

thanks for the quick response !

In this case I guess a button which is added on button save click causes the
problem. Here is the code :

final WebMarkupContainer saveContainer = addComponent(form, withMarkupId(new
WebMarkupContainer("saveContainer")));
saveContainer.setOutputMarkupId(true);
final RepeatingView saveRepeater = addComponent(saveContainer, new
RepeatingView("saveRepeater"));


		table.add(new AjaxButton("save") {

			@Override
			protected void onSubmit(AjaxRequestTarget target, Form<?> form) {

				Fragment content = new Fragment("content", "fragment", saveContainer);

				content.add(new AjaxButton("confirm") {

					@Override
					protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
						...
					}
				});

				content.add(new Button("cancel").add(new AjaxEventBehavior("onclick") {

					@Override
					protected void onEvent(AjaxRequestTarget target) {
						...
					}

				}));

				saveRepeater.add(new Lightbox(saveRepeater.newChildId(), content, new
CloseHandler() {

					@Override
					public void onClose(AjaxRequestTarget target) {
						...

					}
				}));

				target.add(saveContainer);
			}

		});
 

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Random-Component-not-found-error-tp4669449p4669453.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Random 'Component not found' error

Posted by Martin Grigorov <mg...@apache.org>.
Здравей,

The error says that the component is not in the page anymore for any reason.
Do you change the component tree somehow ?
It could be that the slow operation changes the component tree while a
second action is queued to be executed. Once the first operation finishes
Wicket will allow the second to proceed and it will face this problem.

Wicket synchronizes the access to a Page instance so only one thread (i.e.
one http request) can work with a Page instance at a time.
If you fire two consecutive requests to the page then the first that hits
the server is processed first and the second waits on the lock (see
PageAccessSynchronizer).



Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Wed, Feb 11, 2015 at 10:42 AM, sstefanov <st...@gmail.com>
wrote:

> Hello,
>
> I have a strange error 'Component not found', which occurs only when a save
> operation to DB takes some time to complete. If the operation executes fast
> the error is not generated. What is even more strange is that for the same
> test case executed on local machine the error is generated and on the
> development server it's not, for another test case it's the opposite. What
> is the reason for such strange behaviour ? Thanks!
>
> Here is the stack trace :
>
> ERROR - org.apache.wicket.DefaultExceptionMapper 123 - Unexpected error
> occurred
> org.apache.wicket.core.request.handler.ComponentNotFoundException: Could
> not
> find component
>
> 'form:saveContainer:saveRepeater:1:lightboxWrapper:lightbox:content:confirm'
> on page 'class
> com.honda.eu.unitsalesregistration.web.pages.registration.UnitSalesPage
>         at
>
> org.apache.wicket.core.request.handler.PageAndComponentProvider.getComponent(PageAndComponentProvider.java:182)
>         at
>
> org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.getComponent(ListenerInterfaceRequestHandler.java:90)
>         at
>
> org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:231)
>         at
>
> org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:840)
>         at
>
> org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
>         at
> org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:254)
>         at
>
> org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:211)
>         at
>
> org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:282)
>         at
>
> org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:244)
>         at
>
> org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
>         at
>
> org.apache.wicket.protocol.http.WicketServlet.doPost(WicketServlet.java:159)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>         at
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
>         at
>
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
>         at
>
> org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
>         at
>
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
>         at
>
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
>         at
>
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368)
>         at
>
> org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
>         at
>
> org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
>         at
>
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
>         at
>
> org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
>         at
>
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
>         at
>
> org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100)
>         at
>
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
>         at
>
> org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78)
>         at
>
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
>         at
>
> org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
>         at
>
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
>         at
>
> org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35)
>         at
>
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
>         at
>
> org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:177)
>         at
>
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
>         at
>
> org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter.doFilter(DefaultLoginPageGeneratingFilter.java:91)
>         at
>
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
>         at
>
> org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187)
>         at
>
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
>         at
>
> com.honda.eu.framework.security.panex.PanexAuthenticatedProcessingFilter.doFilter(PanexAuthenticatedProcessingFilter.java:89)
>         at
>
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
>         at
>
> org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
>         at
>
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
>         at
>
> org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
>         at
>
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
>         at
>
> org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169)
>         at
>
> org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
>         at
>
> org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
>         at
>
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
>         at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
>         at
> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
>         at
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
>         at
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
>         at
> org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:440)
>         at
>
> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
>         at
>
> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
>         at
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
>         at org.mortbay.jetty.Server.handle(Server.java:326)
>         at
> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
>         at
>
> org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:943)
>         at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
>         at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
>         at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
>         at
>
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
>         at
>
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Random-Component-not-found-error-tp4669449.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>