This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 22115 - Interrupted Exception when re-executing a WebApp on Internal Tomcat
Summary: Interrupted Exception when re-executing a WebApp on Internal Tomcat
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: PC Windows 3.1/NT
: P2 blocker (vote)
Assignee: Petr Nejedly
URL:
Keywords: API
Depends on:
Blocks:
 
Reported: 2002-04-04 22:50 UTC by Sakthivel Gopal
Modified: 2008-12-23 12:17 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Possible solution for the problem. (3.01 KB, application/octet-stream)
2002-04-09 13:42 UTC, Petr Nejedly
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sakthivel Gopal 2002-04-04 22:50:41 UTC
While developing, re-executing a WebApp, when the internal 
tomcat is already running,
If I choose 'Execute Force load' on a Servlet,
I get the following exception everytime :

Thu Apr 04 14:27:02 PST 2002: 
java.lang.InterruptedException: <no message>
java.lang.InterruptedException
        at java.lang.Object.wait(Native Method)
        at java.lang.Object.wait(Object.java:426)
        at org.openide.util.Mutex$QueueCell.sleep
(Mutex.java:1149)
        at org.openide.util.Mutex.enter(Mutex.java:470)
        at org.openide.util.Mutex.postRequest
(Mutex.java:858)
        at org.openide.util.Mutex.postWriteRequest
(Mutex.java:363)
        at org.openide.nodes.Node.destroy(Node.java:302)
        at 
org.netbeans.core.execution.ProcessNodeItem.removeThis
(ProcessNodeItem.java:106)
        at 
org.netbeans.core.execution.ProcessNodeItem$1.finishedExecu
tion(ProcessNodeItem.java:61)
        at 
org.netbeans.core.execution.ExecutionEngine.fireExecutionFi
nished(ExecutionEngine.java:232)
[catch] at org.netbeans.core.execution.RunClassThread.run
(RunClassThread.java:132)

Please Note :
* This happens not only with servlet, any component in the 
webapp
* Though the tomcat re-starting & webapp execution 
continues ok
Comment 1 Damian Frach 2002-04-05 09:22:04 UTC
looks like core problem
Comment 2 _ ttran 2002-04-05 09:53:29 UTC
looks like problem in internal execution
Comment 3 _ ttran 2002-04-05 12:28:03 UTC
the problem is in Mutex.  When the IDE executing something and then
abruptly kills the execution it also spawns a watcher thread .  This
thread is the one who is trying to enter the Mutex.  However approx.
at the same time the IDE is also killing (interrupting?) the watcher
thread causing InterruptedException to be thrown somewhere deep inside
Mutex.

Mutex should rethrow the exception up.  Instead of it it reports the
exception to the user.  From the design point of view I thinks this is
wrong.  Exceptions should be caught at the level where there is enough
information to process them.

What now?  We can either extend the signiature of Mutex.enter() to
have it throw InterruptedException (== breaking backward comp) or
silently swallow the exc, or something else?

Assigning to Petr Nejedly to investigate further

Comment 4 Petr Nejedly 2002-04-09 12:56:15 UTC
We can swallow the exception or only put it into the log,
it should not harm anything (The code in mutex will not give up).

Anyway, the IDE should not interrupt the watcher thread should it?

From looking at the code, it seems that only the execution thread gets
interrupted, not any watcher thread, and that the problem is that:
The started Runnable gets interruped, stops its processing
but doesn't clear the interruped status, so the next sleep
will throw InterruptedException.
IMHO the best solution to teh problem is to call
Thread.interruped() just after the user runnable to clear the status.



lets the 
Comment 5 Petr Nejedly 2002-04-09 13:42:17 UTC
Created attachment 5333 [details]
Possible solution for the problem.
Comment 6 Petr Nejedly 2002-04-09 13:46:35 UTC
I can't reproduce it here and web folks told me that it happens
only about once a month to them, so I have hard time testing it,
but I've developed a possible fix for it.

I've attached a testing jar, please try to place it
to <instalation>/lib/patches and report us whether the problem
persists.
Comment 7 Petr Nejedly 2002-04-11 15:50:42 UTC
I've placed the "possible solution" to trunk. Still waiting
for confirmation from the reporter.
Comment 8 Sakthivel Gopal 2002-04-11 19:40:10 UTC
Great! This seems to work now.
I have copied the jar into <IDEHOME>/lib/patches.
Tried to execute my web app multiple times (execute force/reload), it
worked without this Interrupted exception.
If I remove this patch jar and repeat this exercise, i get everytime i
execute my web app.
So, this patch is a cool fix !
Thanks,
Sakthi
Comment 9 _ ttran 2002-04-12 16:00:26 UTC
Good news indeed.

Petr, please integrate this fix into trunk and ask for integration
into orion_fcs.  Thanks
Comment 10 Petr Nejedly 2002-04-15 15:57:52 UTC
Thanks for testing.
The fix works so I've integrated it in orion_fcs as well.
Comment 11 Jan Zajicek 2002-04-18 14:59:42 UTC
Sakthi, please verify this in Orion, thanks in advance.

Comment 12 Sakthivel Gopal 2002-07-19 23:26:05 UTC
Verified this Orion Builds and now in Siera Build 020817.
I am able to "execute forace load" a servlet when tomcat is running
and there's no interrupted exception.
Hence closing this issue.
-sakthi