Solved

com.ibm.wsspi.webcontainer.ClosedConnectionException

Posted on 2008-06-25
19
12,943 Views
Last Modified: 2013-12-10
Hi,
  In our server logs, this exception getting log.
com.ibm.wsspi.webcontainer.ClosedConnectionException:OutputStream encountered error during write.
What would be possible reason for this? any solution or check we need to make in our application.
IDE-RAD 6.0.1
WAS 6 server.
0
Comment
Question by:Manish
  • 9
  • 4
  • 4
  • +2
19 Comments
 
LVL 24

Expert Comment

by:sciuriware
ID: 21872105
ClosedConnectionException is not a standard exception, so it is not a low-level channel fault.

Seems to me it means that an attempt was made to use a channel that's already closed
by another operation. Did you re-use resources?

;JOOP!
0
 
LVL 11

Author Comment

by:Manish
ID: 21872235
I didnt get this line
>>Seems to me it means that an attempt was made to use a channel that's already closed by another operation. Did you re-use resources?

what is channel? how channel is closed by another operation? what kind of resources?
0
 
LVL 24

Expert Comment

by:sciuriware
ID: 21872354
You made a connection to another application; I call that a (virtual) channel.
Did you use such a connection (object) a second time?

;JOOP!
0
 
LVL 7

Expert Comment

by:humanonomics
ID: 21872355
Do you have the complete stack trace?

I feel, there should be another error on the lower half of the stack trace.

There might be a statement "Caused By ...(another Error)".

giving the stack trace of error might help.
0
 
LVL 11

Author Comment

by:Manish
ID: 21872627
We user oracle 9i database. There we use Connection object.
Here is caused by Stack Trace.
 Caused by: java.io.IOException: Broken pipe]

 	at sun.nio.ch.FileDispatcher.writev0(Native Method)]

 	at sun.nio.ch.SocketDispatcher.writev(SocketDispatcher.java:33)]

 	at sun.nio.ch.IOUtil.write(IOUtil.java:164)]

 	at sun.nio.ch.SocketChannelImpl.write0(SocketChannelImpl.java:329)]

 	at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:350)]

 	at java.nio.channels.SocketChannel.write(SocketChannel.java:360)]

 	at com.ibm.ws.tcp.channel.impl.SocketIOChannel.write(SocketIOChannel.java:122)]

 	at com.ibm.ws.tcp.channel.impl.SocketIOChannel.attemptWriteToSocket(SocketIOChannel.java:880)]

 	at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:629)]

 	... 3 more]

161.136.66.24][Id : FrontControllerServlet/FrontControllerServlet:remoteAddr=172.25.81.1:sessionId=DlWuOAjrL17at-CUtr2DU40][Loc : com.hi.ehouse.services.exceptionhandling.safetynet.ContextCapableSafetyNet.handle(Throwable cause, String identifier)][Desc : 	at sun.nio.ch.IOUtil.write(IOUtil.java:164)]

2008-06-20 00:32:03,514 [WebContainer : 319] FATAL safetynet.ContextCapableSafetyNet - [HostName : inpphapp06 161.136.66.24][Id : FrontControllerServlet/FrontControllerServlet:remoteAddr=172.25.81.1:sessionId=DlWuOAjrL17at-CUtr2DU40][Loc : com.hi.ehouse.services.exceptionhandling.safetynet.ContextCapableSafetyNet.handle(Throwable cause, String identifier)][Desc : 	at sun.nio.ch.SocketChannelImpl.write0(SocketChannelImpl.java:329)]

2008-06-20 00:32:03,515 [WebContainer : 319] FATAL safetynet.ContextCapableSafetyNet - [HostName : inpphapp06 161.136.66.24][Id : FrontControllerServlet/FrontControllerServlet:remoteAddr=172.25.81.1:sessionId=DlWuOAjrL17at-CUtr2DU40][Loc : com.hi.ehouse.services.exceptionhandling.safetynet.ContextCapableSafetyNet.handle(Throwable cause, String identifier)][Desc : 	at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:350)]

2008-06-20 00:32:03,515 [WebContainer : 319] FATAL safetynet.ContextCapableSafetyNet - [HostName : inpphapp06 161.136.66.24][Id : FrontControllerServlet/FrontControllerServlet:remoteAddr=172.25.81.1:sessionId=DlWuOAjrL17at-CUtr2DU40][Loc : com.hi.ehouse.services.exceptionhandling.safetynet.ContextCapableSafetyNet.handle(Throwable cause, String identifier)][Desc : 	at java.nio.channels.SocketChannel.write(SocketChannel.java:360)]

2008-06-20 00:32:03,515 [WebContainer : 319] FATAL safetynet.ContextCapableSafetyNet - [HostName : inpphapp06 161.136.66.24][Id : FrontControllerServlet/FrontControllerServlet:remoteAddr=172.25.81.1:sessionId=DlWuOAjrL17at-CUtr2DU40][Loc : com.hi.ehouse.services.exceptionhandling.safetynet.ContextCapableSafetyNet.handle(Throwable cause, String identifier)][Desc : 	at com.ibm.ws.tcp.channel.impl.SocketIOChannel.write(SocketIOChannel.java:122)]

2008-06-20 00:32:03,515 [WebContainer : 319] FATAL safetynet.ContextCapableSafetyNet - [HostName : inpphapp06 161.136.66.24][Id : FrontControllerServlet/FrontControllerServlet:remoteAddr=172.25.81.1:sessionId=DlWuOAjrL17at-CUtr2DU40][Loc : com.hi.ehouse.services.exceptionhandling.safetynet.ContextCapableSafetyNet.handle(Throwable cause, String identifier)][Desc : 	at com.ibm.ws.tcp.channel.impl.SocketIOChannel.attemptWriteToSocket(SocketIOChannel.java:880)]

2008-06-20 00:32:03,515 [WebContainer : 319] FATAL safetynet.ContextCapableSafetyNet - [HostName : inpphapp06 161.136.66.24][Id : FrontControllerServlet/FrontControllerServlet:remoteAddr=172.25.81.1:sessionId=DlWuOAjrL17at-CUtr2DU40][Loc : com.hi.ehouse.services.exceptionhandling.safetynet.ContextCapableSafetyNet.handle(Throwable cause, String identifier)][Desc : 	at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:629)]

Open in new window

0
 
LVL 11

Author Comment

by:Manish
ID: 21872670
plz ignore after line 12. It was duplicated.
0
 
LVL 24

Accepted Solution

by:
sciuriware earned 40 total points
ID: 21872697
That's something else: the other side has gone away without sending an "over-and-out".
You might as well catch this exception, show a message and just continue the application.

;JOOP!
0
 
LVL 11

Author Comment

by:Manish
ID: 21872870
Are you saying other application[which are possible application?] gone away
without giving us final message.
Basically in my application I am hitting to external urls to get the information, timeout is
3000 ms.
It is possible that it is happening in this case.
0
 
LVL 24

Expert Comment

by:sciuriware
ID: 21873288
Well, there's all kinds of communication:

With a time server, without being asked for it, it gives you a timestamp and goes away instantly,
with a 'question server', it waits for your call, answers and then goes away instantly,
with dialogue servers, you open the 'rally' with a question and finally close when you're done.

So, what's the nature of this communication of yours?

;JOOP!
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 41

Assisted Solution

by:HonorGod
HonorGod earned 60 total points
ID: 21873385
IBM has a defect with a similar error.

http://www.IBM.com/support/docview.wss?rs=180&uid=swg1PK59375

The cause for which is listed as:

One of the JavaServer Pages (JSPs) was attempting to write
data to the output stream after performing a redirect.

Is your page doing, or using redirects?
0
 
LVL 11

Author Comment

by:Manish
ID: 21873596
ya I am using response.sendRedirect in some of jsps.
0
 
LVL 11

Author Comment

by:Manish
ID: 21873620
I am reading external URL which gives xml and parsing that xml
part of code is
socket = new Socket(url.getHost(), port);
                        socket.setSoTimeout(3000);

                        Writer writer =
                              new OutputStreamWriter(
                                    socket.getOutputStream(),
                                    "US-ASCII");
0
 
LVL 41

Expert Comment

by:HonorGod
ID: 21873807
From the (sparse) comment in the APAR description, it sounds like the code that was seeing/causing the error was in the Administration Console where it tried to access the connection after the redirect was done.  Hence, they attempted to use a resource that was invalidated (connection was closed) because of the redirect.
0
 
LVL 11

Author Comment

by:Manish
ID: 21874142
so what kind action should I can take?
0
 
LVL 41

Assisted Solution

by:HonorGod
HonorGod earned 60 total points
ID: 21874736
Does your code do anything related to the connection after the redirect?

Might there be a timing condition where there could occur?

I would consider adding some logging information to your code so that you can understand if this kind of condition was occurring.  If the logging helps you understand how it might be happening, you would certainly have a better chance of changing the code so that it doesn't occur.

Does that make sense?
0
 
LVL 11

Author Comment

by:Manish
ID: 21882239
After redirect there is always new request, new connection. I am not using same connection after redirect. In JSP we dont hit database...through service-daolayer we hit database.
0
 
LVL 11

Author Closing Comment

by:Manish
ID: 31470868
As actual solution was not provided, I am awarding points just for information.
0
 
LVL 41

Expert Comment

by:HonorGod
ID: 21952704
I'm sorry that no definitive solution was provided.  Thanks for the assist.

Good luck & have a great day
0
 

Expert Comment

by:y_nandakumar
ID: 38239897
When accessing external resource, the data retrival purely depends on the volume of the data and the request IO Connection time out.

It is good to check the request time out value and see if the exception is occuring after the timeout period. If so, you need to increase the time out.

In Websphere environment the value set to 60 seconds by default.
http://www.ibm.com/developerworks/forums/thread.jspa?threadID=420840
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
PDFBox - convert image to PDF, PDF resolution 3 119
eclipse shortcuts 9 45
servlet requestdispatcher include and forward differences 1 25
javap not working 8 39
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
This article is about some of the basic and important steps to be used to improve the performance in web-sphere commerce application development. 1) Always leverage the Dyna-caching facility provided by the product 2) Remove the unwanted code …
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

862 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

28 Experts available now in Live!

Get 1:1 Help Now