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 141189 - [65cat][j2ee] AssertionError: Token length=-38 <= 0
Summary: [65cat][j2ee] AssertionError: Token length=-38 <= 0
Status: RESOLVED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: XAM (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Samaresh Panda
URL: http://statistics.netbeans.org/except...
Keywords: RANDOM
Depends on:
Blocks:
 
Reported: 2008-07-22 15:58 UTC by nvarun
Modified: 2008-08-28 06:36 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 71865


Attachments
stacktrace (2.58 KB, text/plain)
2008-07-22 15:58 UTC, nvarun
Details
stacktrace (2.58 KB, text/plain)
2008-07-26 00:07 UTC, thompsonwd40
Details
stacktrace (2.58 KB, text/plain)
2008-07-26 00:10 UTC, thompsonwd40
Details
stacktrace (2.58 KB, text/plain)
2008-07-30 18:11 UTC, richardmijo
Details
stacktrace (2.58 KB, text/plain)
2008-07-30 18:12 UTC, richardmijo
Details
Missing readlock (2.54 KB, text/plain)
2008-08-21 13:31 UTC, Miloslav Metelka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description nvarun 2008-07-22 15:58:39 UTC
Build: NetBeans IDE Dev (Build 200807170007)
VM: Java HotSpot(TM) Client VM, 10.0-b19, Java(TM) SE Runtime Environment, 1.6.0_05-b13
OS: Windows XP, 5.1, x86

User Comments: 
Tried to insert a label, and then Message component from Woodstock Basic components
Comment 1 nvarun 2008-07-22 15:58:47 UTC
Created attachment 65254 [details]
stacktrace
Comment 2 Exceptions Reporter 2008-07-25 18:54:59 UTC
This issue has already 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=71865
Comment 3 thompsonwd40 2008-07-26 00:07:24 UTC
Build: NetBeans IDE Dev (Build 200807251401)
VM: Java HotSpot(TM) Client VM, 1.6.0_03-b05, Java(TM) SE Runtime Environment, 1.6.0_03-b05
OS: Windows XP, 5.1, x86

User Comments: 
[60cat][vwp] Add staticText label to visual editor.  Had added labels earlier in same editing session with no problems, so this was a surprise.

Stacktrace: 
java.lang.AssertionError: Token length=-38 <= 0
        at org.netbeans.lib.lexer.token.DefaultToken.<init>(DefaultToken.java:84)
        at org.netbeans.lib.lexer.token.PropertyToken.<init>(PropertyToken.java:61)
        at org.netbeans.lib.lexer.token.PartToken.<init>(PartToken.java:67)
        at org.netbeans.lib.lexer.JoinLexerInputOperation.createJoinToken(JoinLexerInputOperation.java:263)
        at org.netbeans.lib.lexer.JoinLexerInputOperation.createDefaultTokenInstance(JoinLexerInputOperation.java:237)
        at org.netbeans.lib.lexer.LexerInputOperation.createToken(LexerInputOperation.java:269)
Comment 4 thompsonwd40 2008-07-26 00:07:40 UTC
Created attachment 65693 [details]
stacktrace
Comment 5 thompsonwd40 2008-07-26 00:10:42 UTC
Build: NetBeans IDE Dev (Build 200807251401)
VM: Java HotSpot(TM) Client VM, 1.6.0_03-b05, Java(TM) SE Runtime Environment, 1.6.0_03-b05
OS: Windows XP, 5.1, x86

User Comments: 
[65cat][vwp] Add another StaticText component to visual editor, this error message is identical to the the first StaticText component message.

Stacktrace: 
java.lang.AssertionError: Token length=-38 <= 0
        at org.netbeans.lib.lexer.token.DefaultToken.<init>(DefaultToken.java:84)
        at org.netbeans.lib.lexer.token.PropertyToken.<init>(PropertyToken.java:61)
        at org.netbeans.lib.lexer.token.PartToken.<init>(PartToken.java:67)
        at org.netbeans.lib.lexer.JoinLexerInputOperation.createJoinToken(JoinLexerInputOperation.java:263)
        at org.netbeans.lib.lexer.JoinLexerInputOperation.createDefaultTokenInstance(JoinLexerInputOperation.java:237)
        at org.netbeans.lib.lexer.LexerInputOperation.createToken(LexerInputOperation.java:269)
Comment 6 thompsonwd40 2008-07-26 00:10:53 UTC
Created attachment 65695 [details]
stacktrace
Comment 7 thompsonwd40 2008-07-26 01:55:12 UTC
[65cat][vwp] Request the priority be raised from P3 to P2 - this error occurs every time I drag-n-drop a component to
the design surface in Visual JSF.  Not only a nuisance, but a definite work hindrance.
Comment 8 richardmijo 2008-07-30 18:11:06 UTC
Build: NetBeans IDE Dev (Build 200807251401)
VM: Java HotSpot(TM) 64-Bit Server VM, 10.0-b19, Java(TM) SE Runtime Environment, 1.6.0_05-b13
OS: Linux, 2.6.24-16-generic, amd64

User Comments: 


Stacktrace: 
java.lang.AssertionError: Token length=-36 <= 0
        at org.netbeans.lib.lexer.token.DefaultToken.<init>(DefaultToken.java:84)
        at org.netbeans.lib.lexer.token.PropertyToken.<init>(PropertyToken.java:61)
        at org.netbeans.lib.lexer.token.PartToken.<init>(PartToken.java:67)
        at org.netbeans.lib.lexer.JoinLexerInputOperation.createJoinToken(JoinLexerInputOperation.java:263)
        at org.netbeans.lib.lexer.JoinLexerInputOperation.createDefaultTokenInstance(JoinLexerInputOperation.java:237)
        at org.netbeans.lib.lexer.LexerInputOperation.createToken(LexerInputOperation.java:269)
Comment 9 richardmijo 2008-07-30 18:11:15 UTC
Created attachment 66098 [details]
stacktrace
Comment 10 richardmijo 2008-07-30 18:12:29 UTC
Build: NetBeans IDE Dev (Build 200807251401)
VM: Java HotSpot(TM) 64-Bit Server VM, 10.0-b19, Java(TM) SE Runtime Environment, 1.6.0_05-b13
OS: Linux, 2.6.24-16-generic, amd64

User Comments: 


Stacktrace: 
java.lang.AssertionError: Token length=-36 <= 0
Comment 11 richardmijo 2008-07-30 18:12:38 UTC
Created attachment 66099 [details]
stacktrace
Comment 12 Miloslav Metelka 2008-08-05 17:13:48 UTC
I've tried to add static texts from woodstock several times but the exception did not occur. Added RANDOM keyword since
the report said that several labels were fine...
I've done two bugfixes that might influence the problem - issue 137542 and issue 137872. Could you please attempt to
reproduce in a dev builds after Aug 1? Thanks.
Comment 13 thompsonwd40 2008-08-05 18:48:02 UTC
[65cat] Using build 0802, I replicated the problem.  VWP, drop static text on blank workplace; drop label; drop grid
panel.  All fine so far.  Drag label component on top of grid panel component, received out of bounds condition.  On the
bright side, the behavior has much improved from before.
Comment 14 Exceptions Reporter 2008-08-12 18:52:32 UTC
This issue has already 20 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=71865
Comment 15 Miloslav Metelka 2008-08-21 13:29:22 UTC
Even after trying several times unfortunately I was not able to reproduce the problem.
Anyway in the meantime there were four issues fixed (issue 141151, issue 143759, issue 137809 and today issue 144538)
that might relate to this problem.

Also I've run the build with -J-Dorg.netbeans.spi.lexer.MutableTextInput.level=FINE to see whether the lexer's token
hierarchy is properly accessed under read/write lock and there was one exception (attached) - the XMLSyntaxParser:66 is
accessing the TH without read-lock. Although it's hard to say that this is a culprit (since the embeddings are also
created dynamically from a RequestProcessor) the access to hierarchy without locked document should be avoided (e.g. by
using Document.render() or NbDocument.runAtomic() etc.).
Reassigning to visualweb module for evaluation.
Comment 16 Miloslav Metelka 2008-08-21 13:31:54 UTC
Created attachment 68024 [details]
Missing readlock
Comment 17 nvarun 2008-08-23 18:43:22 UTC
Changed summary for NetCAT 
Comment 18 Peter Zavadsky 2008-08-25 17:15:40 UTC
Missing read lock on document (see mmetelka's comment), probably insync's responsibility to acquire it. Passing there.
Comment 19 _ deva 2008-08-26 19:38:54 UTC
Insync is not handling the faces configuration file, it is just using the results from web/jsf module. This could be a
problem in web JSF implementation. Re-assigning to Po-Ting for more investigation. 

Note that insync has not changed for quite sometime.
Comment 20 _ potingwu 2008-08-26 22:04:45 UTC
> the access to hierarchy without locked document should be avoided (e.g. by using Document.render() or
NbDocument.runAtomic() etc.).
> Created an attachment (id=68024)
> Missing readlock

I think the lock should be implemented at org.netbeans.modules.xml.xam.AbstractModel.sync(AbstractModel.java:259).
The caller does not have object Document available yet when calling getModel.
Comment 21 Samaresh Panda 2008-08-27 19:22:06 UTC
Fixed: http://hg.netbeans.org/main?cmd=changeset;node=edd3fed2bd49.
The diffs look huge because of indentation, the fact is, I just added readLock and readUnlock and removed one unused method.
Comment 22 Quality Engineering 2008-08-28 06:36:48 UTC
Integrated into 'main-golden', available in build *200808280201* on http://bits.netbeans.org/dev/nightly/
Changeset: http://hg.netbeans.org/main/rev/edd3fed2bd49
User: samaresh@netbeans.org
Log: #141189 read lock on document while creating xdm model.