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.
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.
Created attachment 104564 [details] Thread dump taked after the hang
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.
Created attachment 104981 [details] patch proposal 1 I've developed a initial patch. I've not extensively tested it. Go ahead and try it.
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.
Hi Denis, since you are the expert on the model area, could you please review (and possibly apply) this patch? Thanks.
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.
changeset: 186554:d495394387d1
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