tags:

views:

118

answers:

1

When I use NetBeans for almost any task (in particular, attempting to open a project), a red minus sign in the bottom right corner of the IDE starts blinking and I get the following NullPointerException error when I click it. Unfortunately I cannot reinstall NetBeans since I am using a shared computer lab account.

java.lang.NullPointerException
    at org.openide.util.Exceptions.attachMessage(Unknown Source)
    at org.netbeans.modules.project.ant.Util$ErrHandler.annotate(Unknown Source)
    at org.netbeans.modules.project.ant.Util$ErrHandler.fatalError(Unknown Source)
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:388)
    at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1414)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:925)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
    at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:225)
    at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283)
    at org.openide.xml.XMLUtil.parse(Unknown Source)
    at org.netbeans.modules.project.ant.AntBasedProjectFactorySingleton.loadProjectXml(Unknown Source)
    at org.netbeans.modules.project.ant.AntBasedProjectFactorySingleton.loadProject(Unknown Source)
    at org.netbeans.api.project.ProjectManager.createProject(Unknown Source)
    at org.netbeans.api.project.ProjectManager.access$300(Unknown Source)
    at org.netbeans.api.project.ProjectManager$2.run(Unknown Source)
    at org.netbeans.api.project.ProjectManager$2.run(Unknown Source)
    at org.openide.util.Mutex.readAccess(Unknown Source)
    at org.netbeans.api.project.ProjectManager.findProject(Unknown Source)
    at org.netbeans.modules.project.ui.OpenProjectList.fileToProject(Unknown Source)
    at org.netbeans.modules.project.ui.ProjectChooserAccessory$ProjectFileView.run(Unknown Source)
    at org.openide.util.RequestProcessor$Task.run(Unknown Source)
[catch] at org.openide.util.RequestProcessor$Processor.run(Unknown Source)

I took vkraemer's advice and renamed the ~/.netbeans/6.5 directory. I am now able to open one project, but attempting to open another caused 4 errors including the one above.

In addition, attempting to add a server caused the following error:

java.lang.NullPointerException
    at org.netbeans.modules.server.ui.wizard.ServerWizardVisual.isServerValid(Unknown Source)
    at org.netbeans.modules.server.ui.wizard.ServerWizardVisual.isValid(Unknown Source)
    at java.awt.Component.invalidateIfValid(Component.java:2787)
    at java.awt.Component.setLocale(Component.java:1857)
    at javax.swing.JComponent.(JComponent.java:595)
    at javax.swing.JPanel.(JPanel.java:65)
    at javax.swing.JPanel.(JPanel.java:92)
    at javax.swing.JPanel.(JPanel.java:100)
    at org.netbeans.modules.server.ui.wizard.ServerWizardVisual.(Unknown Source)
    at org.netbeans.modules.server.ui.wizard.ServerWizardPanel.getComponent(Unknown Source)
    at org.netbeans.modules.server.ui.wizard.AddServerInstanceWizard$AddServerInstanceWizardIterator.initialize(Unknown Source)
    at org.openide.WizardDescriptor.callInitialize(Unknown Source)
    at org.openide.WizardDescriptor.(Unknown Source)
    at org.openide.WizardDescriptor.(Unknown Source)
    at org.netbeans.modules.server.ui.wizard.AddServerInstanceWizard.(Unknown Source)
    at org.netbeans.modules.server.ui.wizard.AddServerInstanceWizard.(Unknown Source)
    at org.netbeans.modules.server.ui.wizard.AddServerInstanceWizard.showAddServerInstanceWizard(Unknown Source)
    at org.netbeans.modules.server.ui.node.AddServerInstanceAction.performAction(Unknown Source)
    at org.openide.util.actions.NodeAction$DelegateAction$1.run(Unknown Source)
    at org.netbeans.modules.openide.util.ActionsBridge.doPerformAction(Unknown Source)
    at org.openide.util.actions.NodeAction$DelegateAction.actionPerformed(Unknown Source)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
    at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1225)
    at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1266)
    at java.awt.Component.processMouseEvent(Component.java:6263)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
    at java.awt.Component.processEvent(Component.java:6028)
    at java.awt.Container.processEvent(Container.java:2041)
    at java.awt.Component.dispatchEventImpl(Component.java:4630)
    at java.awt.Container.dispatchEventImpl(Container.java:2099)
    at java.awt.Component.dispatchEvent(Component.java:4460)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
    at java.awt.Container.dispatchEventImpl(Container.java:2085)
    at java.awt.Window.dispatchEventImpl(Window.java:2475)
    at java.awt.Component.dispatchEvent(Component.java:4460)
[catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
    at org.netbeans.core.TimableEventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
+1  A: 

The stacktrace comes from the project subsystem. So, it is likely that one of the files associated with an open project is what is causing you grief.

You probably do not need to reinstall NetBeans. You probably need to remove your user directory.

The steps are pretty easy.

  1. shut down netbeans

  2. find your user directory. It is usually located in $HOME/.netbeans/6.5 or %USEERPROFILE%.netbeans\6.5

  3. rename that directory to something like .netbeans/old.6.5

  4. restart NetBeans

  5. Reopen your projects, one by one. If this error reappears, note which project you were opening so you can do more investigation.

vkraemer
Thanks for the suggestion. As you can see if you read my update, I was able to open one project but not another. However, unrelated things, such as adding a Tomcat server, cause null pointer exceptions as well. Any other suggestions? Thanks!
titaniumdecoy
Although I was unable to find a solution, I am marking this answer as accepted since I am no longer working on this project.
titaniumdecoy