我遵循教程构建NetBeans v 7.3.1的简单插件…我知道这是一个旧版本的NetBeans,但是我被我的雇主坚持要使用的软件所限制。
我所有的是一个简单的插件,加载一个工具栏项目,由一个按钮。但是当我运行插件时,我总是在弹出窗口中得到相同的异常警告:
A org.openide.util.RequestProcessor$SlowItem exception has occurred.
Please report this at [blah blah website blah blah log file created]
这个消息对解决问题没有帮助。这是日志文件,作为Java n00b,我一直无法破译或理解其中发生的事情,以弄清楚为什么我得到这个错误。我在搜索中几乎找不到任何信息。如果我读对了(我确信我没有读对),那么错误发生在.jar文件中,我对此无能为力。所以有什么我可以希望做的是出货一个插件,将运行而不抛出异常?解决方法?我小时候错过的什么蠢事?
SEVERE [org.openide.util.RequestProcessor]: Error in RequestProcessor org.openide.loaders.FolderInstance$1R
java.lang.NullPointerException
at org.openide.util.Exceptions$AnnException.getMessage(Exceptions.java:238)
at org.openide.util.Exceptions$AnnException.toString(Exceptions.java:321)
at java.util.Objects.toString(Objects.java:159)
at java.lang.Throwable.initCause(Throwable.java:457)
at org.openide.util.Exceptions$AnnException.findOrCreate0(Exceptions.java:279)
at org.openide.util.Exceptions$AnnException.findOrCreate0(Exceptions.java:286)
at org.openide.util.Exceptions$AnnException.findOrCreate0(Exceptions.java:286)
at org.openide.util.Exceptions$AnnException.findOrCreate0(Exceptions.java:286)
at org.openide.util.Exceptions$AnnException.findOrCreate0(Exceptions.java:286)
at org.openide.util.Exceptions$AnnException.findOrCreate(Exceptions.java:256)
at org.openide.util.Exceptions.attachMessage(Exceptions.java:85)
at org.openide.loaders.InstanceSupport.instanceClass(InstanceSupport.java:157)
at org.openide.loaders.InstanceDataObject$Ser.instanceClass(InstanceDataObject.java:1338)
at org.openide.loaders.InstanceDataObject.instanceClass(InstanceDataObject.java:809)
at org.openide.awt.MenuBar$LazyMenu$MenuFolder.acceptCookie(MenuBar.java:808)
at org.openide.loaders.FolderInstance.acceptDataObject(FolderInstance.java:419)
at org.openide.loaders.FolderInstance.defaultProcessObjects(FolderInstance.java:795)
at org.openide.loaders.FolderInstance.access$000(FolderInstance.java:103)
at org.openide.loaders.FolderInstance$1R.init(FolderInstance.java:693)
at org.openide.loaders.FolderInstance$1R.run(FolderInstance.java:720)
Caused: org.openide.util.RequestProcessor$SlowItem: task failed due to
at org.openide.util.RequestProcessor$Task.schedule(RequestProcessor.java:1473)
at org.openide.loaders.FolderInstance.processObjects(FolderInstance.java:768)
at org.openide.loaders.FolderInstance$Listener.finished(FolderInstance.java:1052)
at org.openide.loaders.FolderList.createBoth(FolderList.java:923)
at org.openide.loaders.FolderList.getObjects(FolderList.java:608)
at org.openide.loaders.FolderList.access$200(FolderList.java:77)
at org.openide.loaders.FolderList$ListTask.computeResult(FolderList.java:1007)
at org.openide.loaders.FolderList$ListTask.run(FolderList.java:983)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1432)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2044)
WARNING [org.netbeans.ProxyClassLoader]: Will not load class org.netbeans.modules.editor.NbCodeFoldingAction arbitrarily from one of ModuleCL@183d64f7[org.netbeans.modules.editor] and ModuleCL@52954826[com.mycompany.TrestleLauncher] starting from SystemClassLoader[263 modules]; see http://wiki.netbeans.org/DevFaqModuleCCE
INFO [org.openide.loaders.FolderInstance.Menu.View]
Cannot get class for MultiFileObject@26bf742[Menu/View/org-netbeans-modules-editor-NbCodeFoldingAction.instance] defined by [jar:file:/C:/Program%20Files/NetBeans%207.3.1/ide/modules/org-netbeans-modules-editor.jar!/org/netbeans/modules/editor/resources/layer.xml]
Cannot get class for MultiFileObject@26bf742[Menu/View/org-netbeans-modules-editor-NbCodeFoldingAction.instance] defined by [jar:file:/C:/Program%20Files/NetBeans%207.3.1/ide/modules/org-netbeans-modules-editor.jar!/org/netbeans/modules/editor/resources/layer.xml]
Caused: java.lang.NullPointerException
at org.openide.util.Exceptions$AnnException.getMessage(Exceptions.java:238)
at org.openide.util.Exceptions$AnnException.toString(Exceptions.java:321)
at java.util.Objects.toString(Objects.java:159)
at java.lang.Throwable.initCause(Throwable.java:457)
at org.openide.util.Exceptions$AnnException.findOrCreate0(Exceptions.java:279)
at org.openide.util.Exceptions$AnnException.findOrCreate(Exceptions.java:256)
at org.openide.util.Exceptions.attachMessage(Exceptions.java:85)
at org.openide.loaders.InstanceSupport.findClass(InstanceSupport.java:506)
at org.openide.loaders.InstanceSupport.instanceClass(InstanceSupport.java:148)
Caused: java.lang.ClassNotFoundException: From file: MultiFileObject@26bf742[Menu/View/org-netbeans-modules-editor-NbCodeFoldingAction.instance] due to
at org.openide.loaders.InstanceSupport.instanceClass(InstanceSupport.java:162)
at org.openide.loaders.InstanceDataObject$Ser.instanceClass(InstanceDataObject.java:1338)
at org.openide.loaders.InstanceDataObject.instanceClass(InstanceDataObject.java:809)
at org.openide.awt.MenuBar$LazyMenu$MenuFolder.acceptCookie(MenuBar.java:808)
[catch] at org.openide.loaders.FolderInstance.acceptDataObject(FolderInstance.java:419)
at org.openide.loaders.FolderInstance.defaultProcessObjects(FolderInstance.java:795)
at org.openide.loaders.FolderInstance.access$000(FolderInstance.java:103)
at org.openide.loaders.FolderInstance$1R.init(FolderInstance.java:693)
at org.openide.loaders.FolderInstance$1R.run(FolderInstance.java:720)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1432)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2044)
ALL [null]: Cannot get class for MultiFileObject@26bf742[Menu/View/org-netbeans-modules-editor-NbCodeFoldingAction.instance] defined by [jar:file:/C:/Program%20Files/NetBeans%207.3.1/ide/modules/org-netbeans-modules-editor.jar!/org/netbeans/modules/editor/resources/layer.xml]
WARNING [org.netbeans.modules.editor.settings.storage.keybindings.KeyMapsStorage]: The keybinding 'A-MOUSE_WHEEL_UP' in Editors/Keybindings/NetBeans/Defaults/org-netbeans-modules-editor-keybindings.xml may not work correctly on Mac. Keybindings starting with Alt or Ctrl should be coded with latin capital letters 'O' or 'D' respectively. For details see org.openide.util.Utilities.stringToKey().
WARNING [org.netbeans.modules.editor.settings.storage.keybindings.KeyMapsStorage]: The keybinding 'A-MOUSE_WHEEL_DOWN' in Editors/Keybindings/NetBeans/Defaults/org-netbeans-modules-editor-keybindings.xml may not work correctly on Mac. Keybindings starting with Alt or Ctrl should be coded with latin capital letters 'O' or 'D' respectively. For details see org.openide.util.Utilities.stringToKey().
WARNING [org.netbeans.ProxyClassLoader]: Will not load class org.netbeans.modules.editor.MainMenuAction$GoToSourceAction arbitrarily from one of ModuleCL@183d64f7[org.netbeans.modules.editor] and ModuleCL@52954826[com.mycompany.TrestleLauncher] starting from SystemClassLoader[263 modules]; see http://wiki.netbeans.org/DevFaqModuleCCE
INFO [org.openide.loaders.FolderInstance.Menu.GoTo]
Cannot get class for MultiFileObject@7e5308ff[Menu/GoTo/org-netbeans-modules-editor-MainMenuAction$GoToSourceAction.instance] defined by [jar:file:/C:/Program%20Files/NetBeans%207.3.1/ide/modules/org-netbeans-modules-editor.jar!/org/netbeans/modules/editor/resources/layer.xml]
Cannot get class for MultiFileObject@7e5308ff[Menu/GoTo/org-netbeans-modules-editor-MainMenuAction$GoToSourceAction.instance] defined by [jar:file:/C:/Program%20Files/NetBeans%207.3.1/ide/modules/org-netbeans-modules-editor.jar!/org/netbeans/modules/editor/resources/layer.xml]
Caused: java.lang.NullPointerException
at org.openide.util.Exceptions$AnnException.getMessage(Exceptions.java:238)
at org.openide.util.Exceptions$AnnException.toString(Exceptions.java:321)
at java.util.Objects.toString(Objects.java:159)
at java.lang.Throwable.initCause(Throwable.java:457)
at org.openide.util.Exceptions$AnnException.findOrCreate0(Exceptions.java:279)
at org.openide.util.Exceptions$AnnException.findOrCreate(Exceptions.java:256)
at org.openide.util.Exceptions.attachMessage(Exceptions.java:85)
at org.openide.loaders.InstanceSupport.findClass(InstanceSupport.java:506)
at org.openide.loaders.InstanceSupport.instanceClass(InstanceSupport.java:148)
Caused: java.lang.ClassNotFoundException: From file: MultiFileObject@7e5308ff[Menu/GoTo/org-netbeans-modules-editor-MainMenuAction$GoToSourceAction.instance] due to
at org.openide.loaders.InstanceSupport.instanceClass(InstanceSupport.java:162)
at org.openide.loaders.InstanceDataObject$Ser.instanceClass(InstanceDataObject.java:1338)
at org.openide.loaders.InstanceDataObject.instanceClass(InstanceDataObject.java:809)
at org.openide.awt.MenuBar$LazyMenu$MenuFolder.acceptCookie(MenuBar.java:808)
[catch] at org.openide.loaders.FolderInstance.acceptDataObject(FolderInstance.java:419)
at org.openide.loaders.FolderInstance.defaultProcessObjects(FolderInstance.java:795)
at org.openide.loaders.FolderInstance.access$000(FolderInstance.java:103)
at org.openide.loaders.FolderInstance$1R.init(FolderInstance.java:693)
at org.openide.loaders.FolderInstance$1R.run(FolderInstance.java:720)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1432)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2044)
ALL [null]: Cannot get class for MultiFileObject@7e5308ff[Menu/GoTo/org-netbeans-modules-editor-MainMenuAction$GoToSourceAction.instance] defined by [jar:file:/C:/Program%20Files/NetBeans%207.3.1/ide/modules/org-netbeans-modules-editor.jar!/org/netbeans/modules/editor/resources/layer.xml]
WARNING [org.netbeans.ProxyClassLoader]: Will not load class org.netbeans.modules.editor.MainMenuAction$GoToSuperAction arbitrarily from one of ModuleCL@183d64f7[org.netbeans.modules.editor] and ModuleCL@52954826[com.mycompany.TrestleLauncher] starting from SystemClassLoader[263 modules]; see http://wiki.netbeans.org/DevFaqModuleCCE
INFO [org.openide.loaders.FolderInstance.Menu.GoTo]
Cannot get class for MultiFileObject@210198eb[Menu/GoTo/org-netbeans-modules-editor-MainMenuAction$GoToSuperAction.instance] defined by [jar:file:/C:/Program%20Files/NetBeans%207.3.1/ide/modules/org-netbeans-modules-editor.jar!/org/netbeans/modules/editor/resources/layer.xml]
Cannot get class for MultiFileObject@210198eb[Menu/GoTo/org-netbeans-modules-editor-MainMenuAction$GoToSuperAction.instance] defined by [jar:file:/C:/Program%20Files/NetBeans%207.3.1/ide/modules/org-netbeans-modules-editor.jar!/org/netbeans/modules/editor/resources/layer.xml]
Caused: java.lang.NullPointerException
at org.openide.util.Exceptions$AnnException.getMessage(Exceptions.java:238)
at org.openide.util.Exceptions$AnnException.toString(Exceptions.java:321)
at java.util.Objects.toString(Objects.java:159)
at java.lang.Throwable.initCause(Throwable.java:457)
at org.openide.util.Exceptions$AnnException.findOrCreate0(Exceptions.java:279)
at org.openide.util.Exceptions$AnnException.findOrCreate(Exceptions.java:256)
at org.openide.util.Exceptions.attachMessage(Exceptions.java:85)
at org.openide.loaders.InstanceSupport.findClass(InstanceSupport.java:506)
at org.openide.loaders.InstanceSupport.instanceClass(InstanceSupport.java:148)
Caused: java.lang.ClassNotFoundException: From file: MultiFileObject@210198eb[Menu/GoTo/org-netbeans-modules-editor-MainMenuAction$GoToSuperAction.instance] due to
at org.openide.loaders.InstanceSupport.instanceClass(InstanceSupport.java:162)
at org.openide.loaders.InstanceDataObject$Ser.instanceClass(InstanceDataObject.java:1338)
at org.openide.loaders.InstanceDataObject.instanceClass(InstanceDataObject.java:809)
at org.openide.awt.MenuBar$LazyMenu$MenuFolder.acceptCookie(MenuBar.java:808)
[catch] at org.openide.loaders.FolderInstance.acceptDataObject(FolderInstance.java:419)
at org.openide.loaders.FolderInstance.defaultProcessObjects(FolderInstance.java:795)
at org.openide.loaders.FolderInstance.access$000(FolderInstance.java:103)
at org.openide.loaders.FolderInstance$1R.init(FolderInstance.java:693)
at org.openide.loaders.FolderInstance$1R.run(FolderInstance.java:720)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1432)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2044)
ALL [null]: Cannot get class for MultiFileObject@210198eb[Menu/GoTo/org-netbeans-modules-editor-MainMenuAction$GoToSuperAction.instance] defined by [jar:file:/C:/Program%20Files/NetBeans%207.3.1/ide/modules/org-netbeans-modules-editor.jar!/org/netbeans/modules/editor/resources/layer.xml]
WARNING [org.openide.filesystems.Ordering]: Not all children in Menu/Window/ marked with the position attribute: [Other], but some are: [org-netbeans-modules-project-ui-logical-tab-action.shadow, org-netbeans-modules-project-ui-physical-tab-action.shadow, org-netbeans-modules-favorites-View.shadow, org-netbeans-core-ide-ServicesTabAction.shadow, org-netbeans-modules-tasklist-ui-TaskListAction.shadow, ShowPaletteAction.shadow, org-netbeans-core-windows-actions-GlobalPropertiesAction.shadow, Output, Navigator, Debug, Versioning, Web, SwitchToRecentDocumentAction.shadow, ProgressListAction.shadow, Separator3.instance, ConfigureWindow, org-netbeans-core-windows-actions-ResetWindowsAction.shadow, Separator4.instance, CloseWindowAction.shadow, CloseAllDocumentsAction.shadow, CloseAllButThisAction.shadow, DocumentsAction.shadow]
WARNING [org.netbeans.TopSecurityManager]: use of system property netbeans.user has been obsoleted in favor of InstalledFileLocator/Places at org.netbeans.modules.uihandler.Installer.logsDirectory(Installer.java:840)
INFO [org.netbeans.core.netigso.Netigso]: bundle org.eclipse.osgi@3.8.0.v20120529-1548 256
INFO [org.netbeans.core.netigso.Netigso]: bundle org.eclipse.osgi@3.8.0.v20120529-1548 stopped
INFO [org.netbeans.core.netigso.Netigso]: bundle org.eclipse.osgi@3.8.0.v20120529-1548 stopped
这似乎是通过Wrapped . jar添加不需要添加的库包的结果(或者更准确地说,需要使用更正确的方法添加)。我需要在NetBeans中按名称(而不是按包)添加模块依赖项,而不是查找、下载和依赖包装的. jar文件来说明依赖项。