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 55439

Summary: Deadlock when creating a web service.
Product: webservices Reporter: _ pcw <pcw>
Component: CodeAssignee: Andrei Badea <abadea>
Status: CLOSED FIXED    
Severity: blocker CC: abadea, jglick, tzezula
Priority: P2 Keywords: THREAD
Version: 4.x   
Hardware: PC   
OS: Windows ME/2000   
Issue Type: DEFECT Exception Reporter:
Attachments: Deadlock vm threaddump.
An attempt to fix

Description _ pcw 2005-02-23 21:11:28 UTC
Deadlock while creating a webservice via wizard. I
used default values for everything except
package=test (already existing).
I had already created 2 services by the same name
and deleted them so I had already existing service
implementation files NewWebServiceSEI.java and
NewWebServiceSEI_1.java (and the respective
implementation files.)

The test package source node was open in the
project explorer, as was the web service node and
it looks like a deadlock between a node updater
(not sure which one) and the web service creation
code.

This was on a slow 2 CPU machine, so that may be
required to reproduce.
Comment 1 _ pcw 2005-02-23 21:12:17 UTC
Created attachment 20490 [details]
Deadlock vm threaddump.
Comment 2 Pavel Buzek 2005-02-28 15:50:26 UTC
looks like the "Error Annotation Queue" locks
CompiledSourceForBinaryQuery.Result in getRoots and tries to get read
access to project, while web service creation locks the project and
tries to call fireChange on the Result.
Comment 3 _ rkubacki 2005-03-14 16:43:25 UTC
What is proper order for aquiring here? Annotation support holds CS4BQ and
requests project mutex, AWT thread has project (it modifies projects files from
wizard) and listener in web project wants CS4BQ. Tome, Jesse canyou commet this?
Comment 4 _ ludo 2005-03-16 04:05:43 UTC
While working on this bug, I have this other one
http://www.netbeans.org/issues/show_bug.cgi?id=56413
related to java files lock I think...
 :-)
Comment 5 Petr Jiricka 2005-03-23 15:38:28 UTC
Tomas and Jesse, any advice on this problem? Thanks.
Comment 6 Andrei Badea 2005-03-24 15:23:36 UTC
I tried hard, but I didn't manage to reproduce this deadlock. It seems that the
"Error Annotation Queue" RP only starts after the WS wizard finishes. To
reporter: can you still reproduce it?

However, IMHO it could be fixed by making CS4BQ$Result.getRoots()
unsynchronized. ISTM this method doesn't have to be synchronized. Tomas agrees.

To reporter: if you can still reproduce, could you please try the attached diff?
Comment 7 Andrei Badea 2005-03-24 15:24:36 UTC
Created attachment 21106 [details]
An attempt to fix
Comment 8 Andrei Badea 2005-03-28 09:36:19 UTC
Removed the synchronized keyword from CS4BQ$Result.getRoots() in order to match
the J2SE project.

Checking in CompiledSourceForBinaryQuery.java;
/cvs/web/project/src/org/netbeans/modules/web/project/queries/CompiledSourceForBinaryQuery.java,v
 <--  CompiledSourceForBinaryQuery.java
new revision: 1.11; previous revision: 1.10
done
Checking in CompiledSourceForBinaryQuery.java;
/cvs/j2ee/ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/queries/CompiledSourceForBinaryQuery.java,v
 <--  CompiledSourceForBinaryQuery.java
new revision: 1.7; previous revision: 1.6
done
Comment 9 Andrei Badea 2005-04-04 09:14:58 UTC
No feedback from the reporter, and I believe my fix removes the deadlock.
Marking as fixed, reopen if necessary.
Comment 10 Lukas Jungmann 2005-04-15 12:55:07 UTC
It seems so.