Question

I'm having a problem with NetBeans 6.9.1 that has cropped up recently after many months of problem-free use. I'm on Red Hat 5.7 coding in Java with Spring and NetBeans RCP.

Every time I open a file, or when I initially open NetBeans and it auto-opens the files I was working on last time, I get a NullPointerException and a message saying that "An error occurred during parsing of (filename)". I get very limited syntax highlighting (keywords in blue, string literals in orange, but nothing else), and none of the NetBeans niceties such code completion, ctrl-click navigation, and fixing imports. More details on that NullPointerException below; this is occurring on a system that is not connected to the internet so I am hand-typing in the first several lines because I can't provide the NetBeans .dump file.

To try to remedy this, I deleted my entire ~/.netbeans directory and restarted NetBeans. It came up as if it were the first time I'd ever run it and asked me to register, as expected (I said "Never register" because I'm not connected to the internet anyway). Then I navigated to my project, and got the same results as before.

The NetBeans Bugzilla site has bug reports of this problem but no information on how to fix it. A site I found in French (developpez.net) suggested that there may be a problem with the syntax of an associated .form file, but the particular file I opened just after blowing away my .netbeans directory doesn't have a .form file and I got the same error - and in any case, when there's a syntax error in the .form file it usually just won't let you edit using the GUI builder.

Any help with this issue would be greatly appreciated!

More on that NullPointerException:

WARNING [org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater]
java.lang.NullPointerException
  at java.util.Arrays$ArrayList.<init>(Arrays.java:3357)
  at java.util.Arrays.asList(Arrays.java:3343)
  at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:67)
  at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161)
...

Update: Since I'm working all alone on a Saturday, I hopped on a coworker's workstation (same network), logged in as myself, and fired up NetBeans - and did not encounter this problem! It remembered what files I had open based on what was in my .netbeans info, and it parsed the Java files and provided syntax highlighting and code navigation. Unfortunately, that workstation didn't have a third-party COTS product installed that I need in order to do my testing, so I have to be on my workstation. I went back to my workstation and crossed my fingers and wished real hard, but the problem persists. But hopefully this will provide a clue for someone who's smarter than me - it's something on MY workstation, but not in my .netbeans directory.

Was it helpful?

Solution

I fixed my problem, so I thought I'd update this in case anybody else runs in to the same thing. All I had to do was reboot my machine - gracefully, since I had to force a reboot at one point while experiencing this problem, and the forced reboot did not resolve the problem.

What I think caused this to occur was that I shut down NetBeans while it was in the process of either scanning projects or checking for external changes (or maybe even both). When I do this, I get the usual popup saying that closing the IDE will cancel these background tasks, and I tell it to close the IDE anyway. After I rebooted (which fixed the initial problem) and after I canceled one of the above tasks and restarted NetBeans, the problem came back until I rebooted again.

I don't know why interrupting a project scan or a check for external changes would cause this behavior, but I can make it happen consistently. Since we use ClearCase and the NetBeans ClearCase plug-in, I need to restart NetBeans whenever I change ClearCase views, and sometimes I get impatient if it happens to be scanning when I want to switch views. I've turned off auto-scan to minimize this problem.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top