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 193882 - Netbeans 6.9.1 hangs while opening faces-config.xml
Summary: Netbeans 6.9.1 hangs while opening faces-config.xml
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: JSF (show other bugs)
Version: 6.x
Hardware: PC Windows XP x64
: P2 normal with 1 vote (vote)
Assignee: Denis Anisimov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-28 14:23 UTC by marcodave
Modified: 2011-01-18 06:13 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Thread dump taked after the hang (24.53 KB, text/plain)
2010-12-28 14:24 UTC, marcodave
Details
patch proposal 1 (11.49 KB, patch)
2011-01-14 00:17 UTC, marcodave
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description marcodave 2010-12-28 14:23:44 UTC
Netbeans hangs when trying to open a faces-config.xml file for a Web project with JSF 1.2.

Attached is a thread dump taken with VisualVM.
From the dump i noticed that the thread 
org.netbeans.modules.web.jsf.JSFConfigEditorSupport is waiting for a lock on a 
org.openide.windows.CloneableOpenSupport$Listener

and the thread AWT-EventQueue-1 is blocked on 
org.netbeans.modules.web.jsf.api.ConfigurationUtils.getConfigModel waiting for a lock.
Comment 1 marcodave 2010-12-28 14:24:48 UTC
Created attachment 104564 [details]
Thread dump taked after the hang
Comment 2 marcodave 2011-01-12 11:55:36 UTC
I think the problem could be here
http://hg.netbeans.org/main/file/4e52836d327b/web.jsf.navigation/src/org/netbeans/modules/web/jsf/navigation/PageFlowController.java#l121

The call on ConfigurationUtils.getConfigModel() is causing a deadlock, since the method is synchronized, and the object org.netbeans.modules.web.jsf.JSFConfigEditorSupport is already owning the lock.

A possibile solution may be removing this call on the constructor and calling the method only when the config model should be really used.
Comment 3 marcodave 2011-01-14 00:17:45 UTC
Created attachment 104981 [details]
patch proposal 1

I've developed a initial patch. I've not extensively tested it. Go ahead and try it.
Comment 4 marcodave 2011-01-14 12:01:38 UTC
I have tried the patched module. I have tried opening the file that precedentely caused the deadlock multiple times and until now the problem did not present itself.
Comment 5 Petr Jiricka 2011-01-14 14:32:46 UTC
Hi Denis, since you are the expert on the model area, could you please review (and possibly apply) this patch? Thanks.
Comment 6 Denis Anisimov 2011-01-17 16:22:55 UTC
You are right about deadlock cause and thanks for proposal .
But there is no need to change client of model 
( PageFlowController ) . The source of the problem is basic model initialization
which should be done at the very beginning : at the editor support is ready .
It is the host of model.
Editor support could keep even model by reference 
( without asking it via ConfigurationUtils ) because the model has 
1:1 with DataObject. 
The deadlock appears only when model is not yet initialized .
So it should be initialized by the host in the editor support.

It will fix the problem with minimal changes.
Comment 7 Denis Anisimov 2011-01-17 16:32:26 UTC
changeset:   186554:d495394387d1
Comment 8 Quality Engineering 2011-01-18 06:13:21 UTC
Integrated into 'main-golden', will be available in build *201101180000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/3bf3e8f32551
User: Denis Anisimov <ads@netbeans.org>
Log: Fix for BZ#193882 -  Netbeans 6.9.1 hangs while opening faces-config.xml