Re: Random 'Component not found' error

2015-02-11 Thread sstefanov
Здравей :)

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-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Random 'Component not found' error

2015-02-11 Thread sstefanov
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-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Random 'Component not found' error

2015-02-11 Thread Martin Grigorov
Здравей,

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 stanislav.stefa...@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)
  

Re: Random 'Component not found' error

2015-02-11 Thread Martin Grigorov
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 stanislav.stefa...@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-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org