Thanks your input.
i had try Control+break in tomcat window. Is this
option only avaliable in tomcat window? can i use it
in other java application running window?

After i click cancel while download from IE. i hit
control+break. and it shows 1 of the running thread
has exception. 

Would that means that thread will be in running state
forever and will never die (never release resource)?
Why this exception didn't print out on screen?  need
Crt+Break instead.  

the following is part of the exception:
"Thread-22" prio=5 tid=0x8def7a8 nid=0x2fc runnable
[0x987f000..0x987fdc4]
        at
java.net.SocketOutputStream.socketWrite(Native Method)
        at
java.net.SocketOutputStream.write(SocketOutputStream.java:83)
        at
org.apache.tomcat.service.http.HttpResponseAdapter.doWrite(HttpResponseAdapter.java:162)
        at 

...etc

thanks.


--- William Kaufman <[EMAIL PROTECTED]> wrote:
> > Any reason cause servlet didn't exit doGet()
> method? I
> > think if doGet() didn't returns, the thread is
> still
> > running, right?
> 
> Probably, yes.  You might be getting an unexpected
> RuntimeException or
> Error, though, which bypasses whatever you do to
> test for exting doGet().
> 
> You can also try hitting the "break" key (it's
> Control+Break in Windows, and
> I think it's Control+Y in Unix) in the window that's
> running Tomcat: that
> will show you the state of all the running threads.
> 
> 
>                                                     
>        -- Bill K.
> 
> 
> > -----Original Message-----
> > From: tim leung [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, May 03, 2001 3:44 PM
> > To: [EMAIL PROTECTED]
> > Subject: RE: Servlet --> File --> Web-browser
> > 
> > 
> > Thanks.
> > I found that even user click cancel in NETSCAPE.
> With
> > apache in the middle servlet will continue send
> the
> > "WHOLE" file to apache.
> > 
> > In IE, if user click cancel, strange thing would
> > happen ( both connection to tomcat directly or
> apache
> > in middle ) :
> > 
> > -  No exception caught in servlet 
> > -  But it looks like my servlet never exits the
> > doGet() method after clicking cancel in IE. 
> > -  It looks like when clicking cancel, TCP
> connection
> > still alive.
> > -  I put a println() in the end of the doGet() but
> it
> > never get print out. It seems servlet "BLOCKS"
> forever
> > in the out.write(int) method of the OutputStream.
> > 
> > Any reason cause servlet didn't exit doGet()
> method? I
> > think if doGet() didn't returns, the thread is
> still
> > running, right? resource (memory / thread) will
> not be
> > free up.
> > 
> > P.S.
> > I am using 
> > tomcat 3.2.1
> > apache 1.3.17
> > 
> > thanks.
> > 
> > 
> > --- William Kaufman <[EMAIL PROTECTED]> wrote:
> > > I didn't answer, because I'd hoped someone could
> say
> > > for sure.  But my own
> > > guesses are:
> > > 
> > > 1) The "Cancel" button in IE doesn't actually do
> > > anything once the data
> > > starts streaming.  I've suspected this was the
> case,
> > > and it sounds like
> > > you've got evidence.
> > > 
> > > 2) Apache is buffering the response somehow:
> > > directly connected to Netscape,
> > > you get an immediate exception when writing to a
> > > closed stream; but, with
> > > Apache in the middle, the writes don't happen
> > > immediately, and no exception
> > > is propagated to the servlet.
> > > 
> > > My only advice would be to flush your servlet
> output
> > > early and often: you
> > > might (or might not) get an exception
> immediately.
> > > 
> > >                                                 
>    
> > >        -- Bill K.
> > > 
> > > 
> > > > -----Original Message-----
> > > > From: alan leung [mailto:[EMAIL PROTECTED]]
> > > > Sent: Thursday, May 03, 2001 10:43 AM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: Re: Servlet --> File --> Web-browser
> > > > 
> > > > 
> > > > can any one helps me out?
> > > > thanks again.
> > > > 
> > > > --- alan leung <[EMAIL PROTECTED]> wrote:
> > > > > Hi,
> > > > > I have a servlet reads a file from
> > > FileInputStream
> > > > > and
> > > > > copy those bytes to ServletOutputStream and
> send
> > > > > back
> > > > > to web browser.
> > > > > 
> > > > > But if user click CANCEL while downloading
> in
> > > > > netscape. i will get an exception in doGet
> > > method.
> > > > > -->
> > > > > IOException in doGet():
> > > java.net.SocketException:
> > > > > Connection aborted by peer: socket write
> error
> > > > > 
> > > > > if user click CANCEL in IE (Internet
> Explorer).
> > > i
> > > > > didn't get any exception print out.
> > > > > 
> > > > > Both cases is browser connect to servlet
> engine
> > > > > directly (tomcat)
> > > > > 
> > > > > if browser connects to apache server -->
> then
> > > > > tomcat;
> > > > > no exception got caught for netscape and IE
> if
> > > user
> > > > > click CANCEL while download. 
> > > > > 
> > > > > What i think is clicking CANCEL while
> > > downloading a
> > > > > file would lost the TCP connection without
> > > ending
> > > > > it.
> > > > > which would always rise an IOException
> right? 
> > > Why
> > > > > if
> > > > > i use apache server w/ tomcat or IE connect
> to
> > > > > tomcat
> > > > > directly won't cause IOException in doGet()
> > > method?
> > > > > 
> > > > > thanks.
> > > > > 
> > > > > 
> > > > > 
> > > > >
> > >
> __________________________________________________
> > > > > Do You Yahoo!?
> > > > > Yahoo! Auctions - buy the things you want at
> > > great
> > > > > prices
> > > > > http://auctions.yahoo.com/
> > > > 
> > > > 
> > > >
> __________________________________________________
> > > > Do You Yahoo!?
> > > > Yahoo! Auctions - buy the things you want at
> great
> > > prices
> > > > http://auctions.yahoo.com/
> > > > 
> > 
> > 
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Auctions - buy the things you want at great
> prices
> > http://auctions.yahoo.com/
> > 


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

Reply via email to