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.
Created attachment 109079 [details] Full thread dump when IDE froze during opening of Java application. Product Version: NetBeans IDE 7.0 (Build 201104080000) Java: 1.6.0_26; Java HotSpot(TM) Client VM 20.1-b02 System: Linux version 2.6.35-22-generic running on i386; UTF-8; cs_CZ (nb) Userdir: /home/cesilko/.netbeans/7.0 Shortly after classpath scanning I wanted to open an already existing Java sample application project but the IDE froze when I hit "Open Project" button. If it matters I had Debugger Core - UI and Project UI NetBeans projects already open in the IDE. I am attaching FTD and screenshot of the frozen IDE. After 10 minutes I killed the IDE.
Created attachment 109080 [details] IDE after minimization. Just a shadow background with Open Project dialog in front.
The interesting part: "Parsing & Indexing Loop (201104080000)" daemon prio=10 tid=0xecb02800 nid=0xe41 in Object.wait() [0xedaf9000] java.lang.Thread.State: RUNNABLE at org.netbeans.modules.j2ee.persistence.api.EntityClassScope.<clinit>(EntityClassScope.java:71) at org.netbeans.modules.j2ee.jpa.model.ModelUtils.getModel(ModelUtils.java:235) "org.netbeans.modules.project.ui.ProjectChooserAccessory$ModelUpdater" daemon prio=10 tid=0x08e0a400 nid=0xe2d in Object.wait() [0xee2fc000] java.lang.Thread.State: RUNNABLE at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:247) at org.netbeans.modules.j2ee.persistenceapi.EntityClassScopeAccessor.<clinit>(EntityClassScopeAccessor.java:61) at org.netbeans.modules.j2ee.persistence.spi.EntityClassScopeFactory.createEntityClassScope(EntityClassScopeFactory.java:66) This is the usual http://wiki.apidesign.org/wiki/FriendPackages pattern, except I think misimplemented in that EntityClassScopeAccessor should not have a static block referencing EntityClassScope, because this can deadlock in the static initializers; rather, EntityClassScopeFactory.createEntityClassScope should do this Class.forName itself. I have a feeling a similar bug was reported in the past against a different module using this pattern. BTW I am not sure what the purpose of the accessor pattern here is to begin with; if anyone can call createEntityClassScope, why not just make EntityClassScope's constructor public (or put the factory method in EntityClassScope)? The only reason I can see for this separation is to make it clear which calls are for API clients vs. for SPI clients.
Right now I'm not sure what for Class.forName is used in EntityClassScopeAccessor as result isn't used anywhere, is there any ideas?
ok, got it, to initialize "DEFAULT", no need to answer prev question.
Jesse, thanks for investigation, will move class.forName to the factory, regarding why it was implemented this way I have no ideas and I'm going to avoid bigger refactoring for now.
http://hg.netbeans.org/web-main/rev/ae827b502c30 moved
Integrated into 'main-golden', will be available in build *201107110600* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/ae827b502c30 User: Sergey B. Petrov <sj-nb@netbeans.org> Log: #199652 - move accessor initializing to factory