当我几乎任何任务使用NetBeans时(特别是尝试打开项目),IDE右下角的红色减号开始闪烁,单击它时出现以下NullPointerException错误。遗憾的是,由于我使用的是共享计算机实验室帐户,因此无法重新安装NetBeans。
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)
我接受了vkraemer的建议并重命名了〜/ .netbeans / 6.5目录。我现在能够打开一个项目,但是尝试打开另一个项目会导致4个错误,包括上面的错误。
此外,尝试添加服务器会导致以下错误:
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)
答案 0 :(得分:1)
堆栈跟踪来自项目子系统。因此,与开放项目相关联的文件之一可能是导致您悲痛的原因。
您可能不需要重新安装NetBeans。您可能需要删除您的用户目录。
步骤非常简单。
关闭netbeans
找到您的用户目录。它是 通常位于 $ HOME / .netbeans / 6.5或 %USEERPROFILE%的.netbeans \ 6.5
将该目录重命名为某个目录 像.netbeans / old.6.5
重新启动NetBeans
逐个重新打开您的项目。 如果再次出现此错误,请记下该错误 你打开的项目,你可以 做更多调查。