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 122977

Summary: Deadlock when creating a Facelets template
Product: editor Reporter: Petr Jiricka <pjiricka>
Component: Painting & PrintingAssignee: issues@editor <issues>
Status: RESOLVED FIXED    
Severity: blocker CC: jbecicka, jiriprox, jjancura, mfukala, ymhsenger
Priority: P2 Keywords: RANDOM, THREAD
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: Deadlock thread dump
The crash of nbfacelets plugin

Description Petr Jiricka 2007-11-28 14:19:58 UTC
Product Version: NetBeans IDE 6.0 (Build 200711261600)
Java: 1.5.0_07; Java HotSpot(TM) Client VM 1.5.0_07-87
System: Mac OS X version 10.4.11 running on i386; MacRoman; en_US (nb)
Userdir: /Users/petrjiricka/.netbeans/6.0

1. Download the facelets 0.6 module from nbfaceletssupport.dev.java.net, install it in the IDE
2. Register GlassFish v2 in the IDE
3. Create a new web project with Facelets framework enabled (accept all defaults)
4. Create a new Facelets template (CSS layout, layout with header, footer and left menu)

=> Deadlock, see attachment
Comment 1 Petr Jiricka 2007-11-28 14:24:05 UTC
Created attachment 53605 [details]
Deadlock thread dump
Comment 2 Marek Fukala 2007-11-28 15:36:21 UTC
looks like editor infrastructure issue
Comment 3 Vitezslav Stejskal 2007-11-30 12:11:48 UTC
Well, I'm not sure if initializing colorings from SLanguageProvider.findLanguage is really necessary. IMO the
initialization of Schliemann languages is still flaky. Simple calls like finding a lexer do not necessarily need to
initialize every feature of the language.

I might try to prevent the deadlock by not calling the highlight layer factories under the lock in HighlightingManager.
The small inefficiency in possibly creating multiple versions of the layers and then throwing them away is probably
acceptable.
Comment 4 Vitezslav Stejskal 2008-01-10 11:36:09 UTC
Probably not fixed just by this, but should be better.

Checking in LexerBasedHighlightLayer.java;
/cvs/java/editor/src/org/netbeans/modules/java/editor/semantic/LexerBasedHighlightLayer.java,v  <-- 
LexerBasedHighlightLayer.java
new revision: 1.3; previous revision: 1.2
done
Comment 5 Jan Becicka 2008-02-01 14:24:09 UTC
Is the deadlock still reproducible after Vita's fix?
Comment 6 Vitezslav Stejskal 2008-02-07 12:08:19 UTC
Created attachment 56229 [details]
The crash of nbfacelets plugin
Comment 7 Vitezslav Stejskal 2008-02-07 12:09:55 UTC
I tried repeating the steps, but the facelets plugin crashed in the step #3. See the messages.log attached.
Comment 8 Petr Pisl 2008-02-07 12:42:12 UTC
Vito, you probably download the plugin for NB 5.1 not for NB 6.0. You should try the snapshot 6. This build contains
some synchronization issues and from the attached deadlock stacktrace it can be already fixed. 
Comment 9 Vitezslav Stejskal 2008-02-07 13:07:46 UTC
Ah, right, now I have the plugin version for Nb6 and it seems to work fine. All steps passed, no deadlock. I'm
reassigning this back to the editor and closing it as fixed. For anybody trying to follow the steps make sure that you
download the right plugin version. You are looking for something like this when installing to Nb6.x:

https://nbfaceletssupport.dev.java.net/files/documents/5684/77220/nbfaceletssupport-0-6.zip
Comment 10 Vitezslav Stejskal 2008-02-07 13:08:48 UTC
Seems to work fine now.