Solved

java.net.SocketException: Socket Closed exception after 1 minute

Posted on 2009-05-18
8
3,139 Views
Last Modified: 2013-12-10
Hi,

I have a web application deployed on Weblogic 10.0.  In the application there is hyperlink to download a resouce (say an PDF document).  Upon clicking the link, IE shows the Open/Save/Cancel dialog box.  If the Open/Save/Cancel dialog box is not acted upon by the user within 1 min after it pops up, Weblogic is closing the socket. This causes IE to only download a part of the file say 128 KB or something. Whereas the entire file maybe 1MB in size.

If however, user clicks on Open or Save within one minute from the time the dialog box showed up, the file gets downloaded just fine.

I am using IE 8. I have tested on IE 7 as well and the problem is there too.

Is there way to increase this timeout of 1 min?

Thanks,
-Piyush

Here is the stacktrace visible on the console:
 

- java.net.SocketException: Socket closed

at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:99)

at java.net.SocketOutputStream.write(SocketOutputStream.java:136)

at weblogic.servlet.internal.ChunkOutput.writeChunkNoTransfer(ChunkOutput.java:548)

at weblogic.servlet.internal.ChunkOutput.writeChunks(ChunkOutput.java:505)

at weblogic.servlet.internal.ChunkOutput.flush(ChunkOutput.java:382)

at weblogic.servlet.internal.ChunkOutput.checkForFlush(ChunkOutput.java:469)

at weblogic.servlet.internal.ChunkOutput.write(ChunkOutput.java:304)

at weblogic.servlet.internal.ChunkOutputWrapper.write(ChunkOutputWrapper.java:137)

at weblogic.servlet.internal.ServletOutputStreamImpl.write(ServletOutputStreamImpl.java:168)

at com.opensymphony.module.sitemesh.filter.RoutableServletOutputStream.write(RoutableServletOutputStream.java:118)

at com.opensymphony.webwork.dispatcher.StreamResult.doExecute(StreamResult.java:202)

at com.opensymphony.webwork.dispatcher.WebWorkResultSupport.execute(WebWorkResultSupport.java:143)

at com.opensymphony.xwork.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:311)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:206)

at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)

at com.opensymphony.xwork.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:168)

at com.opensymphony.xwork.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)

at com.opensymphony.xwork.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:115)

at com.opensymphony.xwork.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)

at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)

at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)

at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)

at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)

at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)

at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)

at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)

at com.opensymphony.xwork.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:186)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)

at com.opensymphony.xwork.DefaultActionProxy.execute(DefaultActionProxy.java:113)

at com.opensymphony.webwork.dispatcher.DispatcherUtils.serviceAction(DispatcherUtils.java:225)

at com.opensymphony.webwork.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:202)

at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)

at com.idsgrp.profinia.server.useractivity.filter.UserActivityFilter.doFilter(UserActivityFilter.java:41)

at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)

at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)

at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)

at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)

at com.opensymphony.webwork.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:88)

at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)

at com.idsgrp.profinia.serverutil.web.DebugFilter.doFilter(DebugFilter.java:31)

at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)

at com.idsgrp.profinia.server.web.UOWUnregisterFilter.doFilter(UOWUnregisterFilter.java:22)

at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)

at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3368)

at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)

at weblogic.security.service.SecurityManager.runAs(Unknown Source)

at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2117)

at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2023)

at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1359)

at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)

at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)
 

java.net.SocketException: Socket closed

at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:99)

at java.net.SocketOutputStream.write(SocketOutputStream.java:136)

at weblogic.servlet.internal.ChunkOutput.writeChunkNoTransfer(ChunkOutput.java:548)

at weblogic.servlet.internal.ChunkOutput.writeChunks(ChunkOutput.java:505)

at weblogic.servlet.internal.ChunkOutput.flush(ChunkOutput.java:382)

at weblogic.servlet.internal.ChunkOutput.checkForFlush(ChunkOutput.java:469)

at weblogic.servlet.internal.ChunkOutput.write(ChunkOutput.java:304)

at weblogic.servlet.internal.ChunkOutputWrapper.write(ChunkOutputWrapper.java:137)

at weblogic.servlet.internal.ServletOutputStreamImpl.write(ServletOutputStreamImpl.java:168)

at com.opensymphony.module.sitemesh.filter.RoutableServletOutputStream.write(RoutableServletOutputStream.java:118)

at com.opensymphony.webwork.dispatcher.StreamResult.doExecute(StreamResult.java:202)

at com.opensymphony.webwork.dispatcher.WebWorkResultSupport.execute(WebWorkResultSupport.java:143)

at com.opensymphony.xwork.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:311)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:206)

at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)

at com.opensymphony.xwork.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:168)

at com.opensymphony.xwork.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)

at com.opensymphony.xwork.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:115)

at com.opensymphony.xwork.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)

at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)

at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)

at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)

at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)

at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)

at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)

at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)

at com.opensymphony.xwork.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:186)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)

at com.opensymphony.xwork.DefaultActionProxy.execute(DefaultActionProxy.java:113)

at com.opensymphony.webwork.dispatcher.DispatcherUtils.serviceAction(DispatcherUtils.java:225)

at com.opensymphony.webwork.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:202)

at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)

at com.idsgrp.profinia.server.useractivity.filter.UserActivityFilter.doFilter(UserActivityFilter.java:41)

at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)

at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)

at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)

at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)

at com.opensymphony.webwork.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:88)

at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)

at com.idsgrp.profinia.serverutil.web.DebugFilter.doFilter(DebugFilter.java:31)

at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)

at com.idsgrp.profinia.server.web.UOWUnregisterFilter.doFilter(UOWUnregisterFilter.java:22)

at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)

at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3368)

at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)

at weblogic.security.service.SecurityManager.runAs(Unknown Source)

at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2117)

at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2023)

at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1359)

at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)

at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)

Open in new window

0
Comment
Question by:p3gasus
  • 4
  • 3
8 Comments
 
LVL 10

Expert Comment

by:rajesh_bala
Comment Utility
Is it a http or https download?

You might want to increase keepalive timeout value and check it out

http://e-docs.bea.com/wls/docs81/ConsoleHelp/domain_virtualhost_config_http.html

0
 
LVL 10

Expert Comment

by:rajesh_bala
Comment Utility
0
 
LVL 27

Expert Comment

by:Asta Cu
Comment Utility
http://e-docs.bea.com/wls/docs100/pdf/plugins.pdf
This for version 10 is an excellent resouce, just search for "keep", quickly find some key options.
0
 

Author Comment

by:p3gasus
Comment Utility
Rajesh_Bala: it is an http download. and we are on weblogic 10.0

I have tried increasing the <keep-alive-secs> in config.xml of weblogic.  but that is not taking effect.  What is perplexing is why does the socket get closed after 1 min (60 seconds) from the time, IE displays the File Download( Open/Save/Cancel) dialog box.

Any other thoughts?
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 10

Expert Comment

by:rajesh_bala
Comment Utility
well, It has to do with keepalive from my experience. Simple reason is that weblogic would maintain the socket open for sometime (until it gets back some data from client. Or server sending data to client).

If the socket is idle beyond this limit, it would simply close the connection.
0
 
LVL 10

Expert Comment

by:rajesh_bala
Comment Utility
can you post the screenshot of your keepalive in weblogic console?
0
 

Author Comment

by:p3gasus
Comment Utility
attaching the screenshot of weblogic console with http keepalive and timeout set
weblogic-keep-alive-time-out.PNG
0
 

Accepted Solution

by:
p3gasus earned 0 total points
Comment Utility
Found the solution.  The parameter that needs tuning is the CompleteMessageTimeout.  It can be found under: Server -> AdminServer -> Protocols -> General (tab).

This value ranges from 0 to 480 seconds.

Make sure to bounce the server the after the change, even though weblogic console says, No restarts necessary!
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Bada platform is becoming more and more famous this days and people talking about same. Some friends included those who have bada OS mobile asked me "what is bada?"and "what its features?". That encouraged me to research and write this article. [st…
SSL stands for “Secure Sockets Layer” and an SSL certificate is a critical component to keeping your website safe, secured, and compliant. Any ecommerce website must have an SSL certificate to ensure the safe handling of sensitive information like…
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.
How to create a custom search shortcut to site-search Experts Exchange using Google in the Firefox browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch your Bookmark Menu: Press 'Ctrl +…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now