Re: multiple AjaxFileDropBehaviour on single page

2019-08-13 Thread Andrew Kondratev
I would simply lock other drag and drop upload components, while upload is in 
progress. 

You can also have a look at my experiments with custom drag and drop upload 
fields here https://github.com/andruhon/WicketDragAndDropFileAjaxUpload
I have similar implementation in my app and it does allow you to drop files 
into multiple drag and drop area, however, files are uploaded sequentially, one 
by one.


On 2019/08/13 06:19:08, Korbinian Bachl  wrote: 
> Hi,
> 
> wicket 8 has this neat AjaxFileDropBehaviour and it works like charm. 
> However, if I have multiple components on one page with a 
> AjaxFileDropBehaviour each and the upload of 1 drop is running, i cant upload 
> a 2nd one at the same time; Any idea how to solve this? 
> 
> E.g.: File 1 with 100MB gets dropped onto component A, File B wiht 50MB gets 
> dropped onto Component B about 10 secs later - upload of a is not working and 
> page somehow goes stale. It might be noteworthy that during the upload an 
> IAjaxIndicatorAware spinner is shown on Component A (and expected on B);
> 
> Best,
> 
> KB
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 

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



getPageClass locks the page

2019-08-12 Thread Andrew Kondratev
Hi!

My colleague noticed some dodgy behavior, which I think could be a bug.
Just asking here if it's known, befor I try to create a quickstart or PR.

* page is rendered
* user interacts with a page causing ajax request (clicking checkbox)
* the wicket PageAccessSynchronizer locks, renders and unlocks the page
with that id
* after that, custom request logger asks for the className of the current
page
* the PageProvider doesn't have it on hand, so has to ask for the page from
DefaultMapperContext#getPageInstance
* that in turn locks the page again -- without unlocking it
* so subsequent interaction with the same component blows up after a minute
of not being able to get the lock for the page

Wicket 8.5.0

The stack trace
org.apache.wicket.page.CouldNotLockPageException: Could not lock page 86.
Attempt lasted 1 minute
at
org.apache.wicket.page.PageAccessSynchronizer.lockPage(PageAccessSynchronizer.java:168)
at
org.apache.wicket.page.PageAccessSynchronizer$2.getPage(PageAccessSynchronizer.java:246)
at
org.apache.wicket.DefaultMapperContext.getPageInstance(DefaultMapperContext.java:101)
at
org.apache.wicket.core.request.handler.PageProvider$Provision.resolve(PageProvider.java:412)
at
org.apache.wicket.core.request.handler.PageProvider.getProvision(PageProvider.java:163)
at
org.apache.wicket.core.request.handler.PageProvider.getPageInstance(PageProvider.java:171)
at
org.apache.wicket.core.request.handler.PageProvider.getPageClass(PageProvider.java:257)
at
org.apache.wicket.core.request.handler.ListenerRequestHandler.getPageClass(ListenerRequestHandler.java:108)
at
org.apache.wicket.protocol.https.HttpsMapper.getDesiredSchemeFor(HttpsMapper.java:199)
at
org.apache.wicket.protocol.https.HttpsMapper.mapRequest(HttpsMapper.java:103)
at
org.apache.wicket.request.mapper.CompoundRequestMapper.mapRequest(CompoundRequestMapper.java:147)
at
org.apache.wicket.request.cycle.RequestCycle.resolveRequestHandler(RequestCycle.java:193)
at
org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:243)
at
com.mycompany.core.web.framework.MyRequestCycle.processRequest(MyRequestCycle.java:129)
at
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:221)
at
org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:275)
at
org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:206)
at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:299)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at
com.mycompany.core.web.filter.ResponseHeadersFilter.doFilter(ResponseHeadersFilter.java:31)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at
com.mycompany.core.web.filter.MDCEnhancingFilter.lambda$doFilterInternal$0(MDCEnhancingFilter.java:29)
at
com.mycompany.common.logging.LoggingContextUtil$VoidCallable.call(LoggingContextUtil.java:168)
at
com.mycompany.common.logging.LoggingContextUtil$VoidCallable.call(LoggingContextUtil.java:163)
at
com.mycompany.common.logging.LoggingContextUtil.runWithLoggingContext(LoggingContextUtil.java:65)
at
com.mycompany.common.logging.LoggingContextUtil.runWithLoggingContext(LoggingContextUtil.java:34)
at
com.mycompany.core.web.filter.MDCEnhancingFilter.doFilterInternal(MDCEnhancingFilter.java:29)
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.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:317)
at
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127)
at
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at
org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:115)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at
org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at
org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
at
or