yup, you are right william.

it's not really exception. it's thread's running state
at the time i push Crt+Break. 

One thing i have been stuck for 1/2 month is that :

why the thread still running when i click canel on IE?
click cancel in IE (i think) would close the TCP
connection. servlet would konw that in the socket
immediately ( this is the case in netscape). and
caught an exception.

I suspect IE still keeps the TCP connection even after
user click cancel. (that's bit strange idea).  but
what else can keep the thread in servlet keep running
if the socket is closed?  the thread didn't dies if i
make another request, it's still there.

I am using JBuilder and i think the thread panel is
same as the option Ctrl+Break.  

thanks.





--- William Kaufman <[EMAIL PROTECTED]> wrote:
> > 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?
> 
> It'll work in any Java application.
> 
> > After i click cancel while download from IE. i hit
> > control+break. and it shows 1 of the running
> thread
> > has exception. 
> 
> It's not actually an exception--it just looks like
> one.  It dumps the stacks
> for all the running threads.  So, for the stack you
> show, it just tells you
> that that thread is hung while writing to a
> socket--pretty much what you
> expected.
> 
>                                                     
>        -- Bill K.
> 
> 
> > -----Original Message-----
> > From: tim leung [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, May 03, 2001 4:44 PM
> > To: [EMAIL PROTECTED]
> > Subject: RE: Servlet --> File --> Web-browser
> > 
> > 
> > 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(Htt
> > pResponseAdapter.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
> > > > > > 
> > > > > > 
> 
=== message truncated ===


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

Reply via email to