Friday March 17, 2006
NullPointerException (NPE) from FileScanner removeFromRepository?
If you see this NPE in NetBeans 5.0, it means your project source code repository is corrupted. When this happens, the code completion (CTRL-space) for JDK classes (e.g., String, System, etc) stops working. Everything else still works beautifully. But I still found it a little inconvenient, since I seldom type in complete class/method/variable names inside NetBeans. Of course, if you know all the JDK classes, their fields, methods, each method parameters, and you enjoy typing, then it may not be a big problem for you.
Fortunately, there is a simple solution. Several NetBeans developers graciously offered their help: delete this directory $netbeans_user_dir/var/cache/mdrstorage. In a typical installation, it is $HOME/.netbeans/5.0/var/cache/mdrstorage/
For more information, refer to the this issue. If you have an idea, please contribute to this great open-source IDE and make it even better.
PS: I use Google as a debugging tool: everytime I have this type of problem, I google it to see if it happens to others. However, this time Google didn't return any matching results. So I posted it here, hoping Google can do better next time whoever searches for this NPE.
The stacktrace is as follows:
java.lang.NullPointerException
at
org.netbeans.modules.javacore.scanning.FileScanner.removeFromRepository(FileScanner.java:194)
at
org.netbeans.modules.javacore.scanning.FileScanner.scan(FileScanner.java:179)
[catch] at
org.netbeans.modules.javacore.JMManager.scanFiles(JMManager.java:1092)
at
org.netbeans.modules.javacore.JMManager.resolveCPRoot(JMManager.java:1006)
at
org.netbeans.modules.javacore.JMManager.resolveCodebases(JMManager.java:815)
at
org.netbeans.modules.javacore.JMManager$2.run(JMManager.java:769)
at
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:493)
at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:926)
Posted at 10:27PM Mar 17, 2006 by chengfang in NetBeans | Comments[3]
Posted by Tomas Hurka on March 19, 2006 at 04:47 AM EST #
Posted by John on May 09, 2007 at 02:22 AM EDT #
thanks. Very good solution. Solve my problem too.
By.
Posted by Marcos on November 28, 2007 at 08:44 PM EST #