[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Occasional issue with BufferedContent in docker  XML
Forum Index -> Development
Author Message
mmohr

Active

Joined: 13/04/2021 08:22:08
Messages: 7
Offline

Hello,
I'm occasionally experiencing an issue using BufferedContent for downloading with multiple sessions simultaneously, but only when tomcat is running in docker. The exception says, that no Object has been found in buffered content. I'm of course making sure, that Code:
BufferedContentMgr.add()
is called with a non null value.

The exception looks like this:
Code:
Nov 15, 2021 1:46:24 PM org.apache.catalina.core.StandardWrapperValve invoke
 SEVERE: Servlet.service() for servlet [BufferedContentServlet] in context with path [] threw exception [Servlet execution threw an exception] with root cause
 java.lang.Exception: Could not find any object in buffered content
 	at org.eclnt.jsfserver.bufferedcontent.BufferedContentServlet.processRequest(BufferedContentServlet.java:64)
 	at org.eclnt.jsfserver.util.CCServletBaseWithContextMgmt.manageRequest(CCServletBaseWithContextMgmt.java:99)
 	at org.eclnt.jsfserver.util.CCServletBaseWithContextMgmt.doGet(CCServletBaseWithContextMgmt.java:52)
 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:655)
 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
 	at org.eclnt.jsfserver.util.ResponseLoggerFilter.doFilter(ResponseLoggerFilter.java:276)
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
 	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:320)
 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:320)
 	at de.nexus.http.filter.SecurityHeaderFilter.doFilter(SecurityHeaderFilter.java:44)
 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
 	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:82)
 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
 	at org.springframework.web.filter.ForwardedHeaderFilter.doFilterInternal(ForwardedHeaderFilter.java:149)
 	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
 	at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215)
 	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:186)
 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
 	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:334)
 	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:119)
 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
 	at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)
 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
 	at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)
 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
 	at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170)
 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
 	at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
 	at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:158)
 	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
 	at org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter.doFilter(DefaultLoginPageGeneratingFilter.java:206)
 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
 	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200)
 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
 	at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116)
 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
 	at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:74)
 	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
 	at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)
 	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
 	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)
 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
 	at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215)
 	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178)
 	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:358)
 	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:271)
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)
 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
 	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:540)
 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
 	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:687)
 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357)
 	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:382)
 	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
 	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:895)
 	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1722)
 	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
 	at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
 	at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
 	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
 	at java.base/java.lang.Thread.run(Thread.java:829)


Do you perhaps have any idea what this could be caused by?
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5518
Offline

Hi,

are you running in a cluster scenario - or in a single server (e.g. Tomcat) scenario? If "cluster" then the routing of requests needs to be checked.

But: I assume "single server"...

Then the "only possibility" is, that the content is somehow removed too early. Could you check the way you remove the content? (BufferedContentMgr.remove(...))

There is an excessive INFO-level-logging in the BufferedContentMgr, all log messages starting with "BufferedContentMgr:". Please switch the loggging to level "INFO" (logging.xml file in eclntjsfserver/config) and search for the bufferId which is not found?

The default logging is done to the servlet enginge's temp directory, for Tomcat this is tomcat/work/Catalina/localhost - but the logging is configureable... ;-)

Kind regards! Björn

Björn Müller, CaptainCasa GmbH
mmohr

Active

Joined: 13/04/2021 08:22:08
Messages: 7
Offline

Hi again,
thanks for the help, you were right. The log is indicating that the content is removed too early.
I'm using a filedownloadbutton. I have specified a method to be called on the downloadUrl property, which does the "BufferedContentMgr.add()" call if it hasn't been done. I also have an actionListener specified, which does the "BufferedContentMgr.remove()" call.
Is that correct, or should the "BufferedContentMgr.remove" rather be called somewhere else?
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5518
Offline

Hi,

the action listener behind the filedownloadbutton (same with other filedownload-components) is executed when the browser takes over the URL and plans to open it. So it is not a confirmation about the file being downloaded, but more a signal that the download is touched. So, removing the content at this point of time could be too fast... ;-)

Best remove the content, when the corresponding page is closed. E.g. if it is a popup: if the popup is closed. Or if it is a workpalce: when the workpage is closed.

Regards, Björn

Björn Müller, CaptainCasa GmbH
mmohr

Active

Joined: 13/04/2021 08:22:08
Messages: 7
Offline

Thanks, makes sense now.
I implemented this as a popup and I want it to be closed, as soon as the download is finished.
The only thing I found as callback after the download has been finished is by overriding the "endGetting" method of "DefaultBufferedContent". Therefore i tried to put the removing of content and closing the popup in this method. Removing the content works, but now the popup doesn't close
Is this the wrong place for a "Download finished" callback or do you have any other idea?
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5518
Offline

Hi,

unfortunately there is no proper event that we can offer.

The "downloadfinished" sounds like the right one... - but is mis-leading. (Once upon a time there was a Swing-client, in which we had explicit control about the download process... but in the browser: not possible)

So I believe you have to add an "Exit" button to your popup dialog...

Kind regards, Björn

Björn Müller, CaptainCasa GmbH
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team