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.
AFAIR I've just started netbeans and opened an ant web project.
Created attachment 107696 [details] The threads dump
Happened on a dev build few days old. I haven't evaluated the issue thoroughly but since there's a lot of web stuff, passing to web project resp. engineer knowledgeable in this area. Not reproducible, seems to happen rarely => P2
Suppose, could be related to issue #178165. Thread dump looks different than mine ones earlier but still about the same thing. CCing Petr, he's challenging these troubles and will know more - if it's related/already fixed.
(In reply to comment #3) > Suppose, could be related to issue #178165. Thread dump looks different than > mine ones earlier but still about the same thing. CCing Petr, he's challenging > these troubles and will know more - if it's related/already fixed. Not really. Looks like lock ordering problem between project mutex and ProjectWebModule in "Load Open Projects" and "init libs -- Hk2JavaEEPlatformImpl". Perhaps WebProjectJAXWSSupport.getWebservicesMetadataModel should acquire project lock in advance to prevent this. Just guessing.
This is not a new deadlock - the opportunity was there for a long time but it just has not happened until now. I think that synchronization of org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeModuleProvider is wrong or dangerous. It is an abstract class which is extended by several subclasses and most of them synchronize methods which do stuff like "MetadataModelFactory.createMetadataModel" (which in turn call bunch of other stuff from Java to Project infrastructure). Well, it's been like that since at least NB5 so I do not want to touch it. As for workarounds I agree with PetrH that WebProjectJAXWSSupport.getWebservicesMetadataModel should acquire project read lock. That will prevent this instance of the issue. PetrH, one question: would it be possible to rewrite j2ee.common.Util.getJ2eePlatformClasspathEntries() to not acquire J2eeModuleProvider lock? That seems to me quite dangerous as well. The method name itself is pretty innocent and it is frequently called from under a Project Write lock (eg. when project properties are updated). Fixing that would worakround this issue as well.
(In reply to comment #5) > PetrH, one question: would it be possible to rewrite > j2ee.common.Util.getJ2eePlatformClasspathEntries() to not acquire > J2eeModuleProvider lock? That seems to me quite dangerous as well. The method > name itself is pretty innocent and it is frequently called from under a Project > Write lock (eg. when project properties are updated). Fixing that would > worakround this issue as well. Done ;) Formally this could be considered api change, so I changed module versions. However I checked all usages and nobody use the object monitor of J2eeModuleProvider to synchronize intentionally on J2eeModuleProvider's state. Such usage would be broken anyway. web-main 1b60db58205b
(In reply to comment #6) > Done ;) Thanks!
Integrated into 'main-golden', will be available in build *201104140401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/1b60db58205b User: phejl@netbeans.org Log: #197674 Threads locked during web project open