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 111189 - Encountering java.lang.AssertionError upon startup everytime
Summary: Encountering java.lang.AssertionError upon startup everytime
Status: VERIFIED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P1 blocker (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-27 06:24 UTC by frankioski
Modified: 2008-04-09 12:28 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Attaching messages.log (78.96 KB, text/plain)
2007-07-27 06:25 UTC, frankioski
Details
Attaching messages.log (77.57 KB, text/plain)
2007-07-27 18:08 UTC, frankioski
Details
Patched module. (207.17 KB, application/octet-stream)
2007-07-27 20:13 UTC, Jan Lahoda
Details

Note You need to log in before you can comment on or make changes to this bug.
Description frankioski 2007-07-27 06:24:58 UTC
Build: M10

I was editing Java code inside the Java editor when I suddenly found myself unable to use any of the error keys and
delete keys to make edits.  Hitting those keys causes no response whatsoever even though I could continue typing
characters.  So, I shut down the IDE and restarted it.  In the middle of loading modules, before the IDE frame even
opens, the NetBeans logo box disappears, and in its place is a small dialogue box that is titled "Unexpected Exception".
 It says, "A java.lang.AssertionError exception has occurred. Please report this at..."
Comment 1 frankioski 2007-07-27 06:25:54 UTC
Created attachment 45808 [details]
Attaching messages.log
Comment 2 frankioski 2007-07-27 06:31:12 UTC
This has to be a P1 now.  All subsequent attempts to restart NetBeans lead to the aforementioned "Unexpected Exception"
dialog box.  WTF????
Comment 3 frankioski 2007-07-27 06:48:25 UTC
Startup aborts upon encountering the exception, which appears when "Done loading modules" appears in the logo.  Clicking
"Close" simply closes the exception window and then nothing.  Opening the Windows Task Manager > Processes tab shows a
java.exe running, taking up 135,588 K of memory and 60 GDI objects.
Comment 4 frankioski 2007-07-27 06:52:56 UTC
In my original description, I mistakenly wrote "error keys" when I actually meant to write "arrow keys".  None of the
arrow keys worked.
Comment 5 Peter Pis 2007-07-27 08:22:13 UTC
Reassigning to "debugger" for evaluation...
Comment 6 Martin Entlicher 2007-07-27 10:15:29 UTC
It's some undescribed AssertionError comming from javac. Moving to java for evaluation...

java.lang.AssertionError
	at com.sun.tools.javac.api.JavacTaskImpl.parse(JavacTaskImpl.java:231)
	at org.netbeans.modules.java.source.TreeLoader.loadTreeFor(TreeLoader.java:70)
Comment 7 Petr Hrebejk 2007-07-27 16:50:50 UTC
Honzo, can you dispatch it?
Comment 8 frankioski 2007-07-27 18:08:08 UTC
Wade Chandler made the suggestion that I delete var/cache directory under the netbeans userdir.  Doing so does allow NB
to restart.  However, the same error returns upon the next restart unless I once again delete the var/cache directory. 
This is the case now at every restart.
Comment 9 frankioski 2007-07-27 18:08:41 UTC
Created attachment 45836 [details]
Attaching messages.log
Comment 10 frankioski 2007-07-27 18:09:57 UTC
Also, not only would I need to delete the var/cache folder, I would also need to kill the orphaned java.exe process via
Windows Task Manager > Processes tab.
Comment 11 frankioski 2007-07-27 18:18:46 UTC
Eversince this incident, I'm noticing that certain functions stop working in NB.  So far, I'm observing the following:

1. Auto indentation not working at all; I need to manually indent and format every line.
2. Errors are not being displayed when I make syntax or punctuation errors in the Java editor.
Comment 12 Jan Lahoda 2007-07-27 20:12:40 UTC
While I cannot reproduce and while exact details are still a bit unclear to me, I think that the principal problem is
that EditorContextImpl.getFieldLineNumber (as well as getMethodLineNumber) does not properly call toPhase inside the
runUserActionTask.

Reporter, I will attach corrected version of the corresponding module (org-netbeans-modules-debugger-jpda-projects.jar).
Could you please test it? Backup the original from
${NETBEANS_INSTALL_DIR}/java1/modules/org-netbeans-modules-debugger-jpda-projects.jar, and replace it by the attached
version and try to reproduce the problem. Thanks.
Comment 13 Jan Lahoda 2007-07-27 20:13:37 UTC
Created attachment 45843 [details]
Patched module.
Comment 14 frankioski 2007-07-29 01:05:21 UTC
The patch seems to be working.  Also, the indentation problem is not reappearing.
Thanks.

I'm wondering whether the breakage might have occurred when I did a hard shutdown (via Windows Task Manager).  I think
what happened was that I forgot that I had been running the remote debugger, and I proceeded to run an ant target from
the Navigator window.  Seeing the build process continued to be queued, I then realized that the remote debugger was
still running.  I stopped the debugger, but the queued ant build would remain queued.  Now that I was stuck, I could
only do the hard shutdown.  The next startup of the IDE seemed to be fine, though, as I continued to work with no
apparent problems until I found the arrow keys and delete key non-functional at all (this has happened before with NB
6--see issue 108563).  Then I soft-shutdown the IDE.  The assertion error started to appeared after that.
Comment 15 frankioski 2007-07-29 01:12:39 UTC
By the way, the queued ant process was stuck; it would not run after I killed the debugger and I could not cancel it out
of the queue.  I tried.  I've experienced the same problem with many queued processes in NetBeans.

My project is a web project with existing ant script, using JDK 1.4.2 and J2EE 1.3 compliant.
Comment 16 Jan Lahoda 2007-07-30 13:29:52 UTC
Ok, thanks. I have committed the changes corresponding to the binary patch that I have attached.

I do not think this was caused by killing NetBeans or any other process, but rather some combination of field/method
breakpoints and opened/not-opened files in the editor. Please file separate issues for the problems with canceling the
processes as necessary. Thanks.

BTW: There is also issue in Java infrastructure (issue #104612), which, when fixed, should make consequences of
forgotten CompilationController.toPhase less fatal.

Checking in EditorContextImpl.java;
/cvs/debuggerjpda/projects/src/org/netbeans/modules/debugger/jpda/projects/EditorContextImpl.java,v  <-- 
EditorContextImpl.java
new revision: 1.29; previous revision: 1.28
done
Comment 17 Jan Lahoda 2007-07-30 13:32:09 UTC
Fixed.
Comment 18 pribyl 2008-04-09 12:28:58 UTC
Verified