如何解决未处理的事件循环异常

时间:2015-10-12 12:47:29

标签: java cocoa java-ee testng eclipse-luna

我在我的mac系统中使用Eclipse Luna Service第2版(4.4.2)。我从市场安装了testng。 当我尝试使用testng.xml 作为Testng套件运行时,我在错误日志窗口中遇到两个错误,并且没有启动testng。但是,如果我在单个类级别运行相同的(不使用testng.xml),它将被正确触发而不会出现问题。

1-来自Error.log的消息"错误" - 堆栈跟踪:

java.lang.NullPointerException
    at org.testng.eclipse.ui.util.ConfigurationHelper.getBooleanAttribute(ConfigurationHelper.java:374)
    at org.testng.eclipse.ui.util.ConfigurationHelper.isPrefixVmArgsFromPom(ConfigurationHelper.java:122)
    at org.testng.eclipse.ui.util.ConfigurationHelper.getVMArgsFromPom(ConfigurationHelper.java:219)
    at org.testng.eclipse.ui.util.ConfigurationHelper.getJvmArgs(ConfigurationHelper.java:180)
    at org.testng.eclipse.util.LaunchUtil.launchSuiteConfiguration(LaunchUtil.java:152)
    at org.testng.eclipse.util.LaunchUtil.launchSuiteConfiguration(LaunchUtil.java:125)
    at org.testng.eclipse.util.LaunchUtil.launchSuiteConfiguration(LaunchUtil.java:113)
    at org.testng.eclipse.launch.TestNGSuiteLaunchShortcut.run(TestNGSuiteLaunchShortcut.java:38)
    at org.testng.eclipse.launch.TestNGSuiteLaunchShortcut.launch(TestNGSuiteLaunchShortcut.java:20)
    at org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension.launch(LaunchShortcutExtension.java:431)
    at org.eclipse.debug.internal.ui.actions.LaunchShortcutAction.run(LaunchShortcutAction.java:74)
    at org.eclipse.debug.internal.ui.actions.LaunchShortcutAction.runWithEvent(LaunchShortcutAction.java:123)
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:595)
    at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:511)
    at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:420)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4199)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1467)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1490)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1475)
    at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1279)
    at org.eclipse.jface.action.ActionContributionItem$9.handleEvent(ActionContributionItem.java:1293)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4199)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1467)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1490)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1475)
    at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1279)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4042)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3669)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1465)

会话数据:

java.version=1.8.0_60
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.jee.product -keyring /Users/xxxxxxx/.eclipse_keyring -showlocation
Command-line arguments:  -os macosx -ws cocoa -arch x86_64 -product org.eclipse.epp.package.jee.product -keyring /Users/xxxxxxx/.eclipse_keyring -showlocation

2。来自error.log的错误消息'未处理的事件循环异常'

异常堆栈跟踪:

java.lang.NullPointerException
    at org.testng.eclipse.ui.util.ConfigurationHelper.getJvmArgs(ConfigurationHelper.java:188)
    at org.testng.eclipse.util.LaunchUtil.launchSuiteConfiguration(LaunchUtil.java:152)
    at org.testng.eclipse.util.LaunchUtil.launchSuiteConfiguration(LaunchUtil.java:125)
    at org.testng.eclipse.util.LaunchUtil.launchSuiteConfiguration(LaunchUtil.java:113)
    at org.testng.eclipse.launch.TestNGSuiteLaunchShortcut.run(TestNGSuiteLaunchShortcut.java:38)
    at org.testng.eclipse.launch.TestNGSuiteLaunchShortcut.launch(TestNGSuiteLaunchShortcut.java:20)
    at org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension.launch(LaunchShortcutExtension.java:431)
    at org.eclipse.debug.internal.ui.actions.LaunchShortcutAction.run(LaunchShortcutAction.java:74)
    at org.eclipse.debug.internal.ui.actions.LaunchShortcutAction.runWithEvent(LaunchShortcutAction.java:123)
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:595)
    at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:511)
    at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:420)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4199)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1467)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1490)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1475)
    at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1279)
    at org.eclipse.jface.action.ActionContributionItem$9.handleEvent(ActionContributionItem.java:1293)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4199)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1467)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1490)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1475)
    at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1279)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4042)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3669)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1465)

会话数据:

eclipse.buildId=4.4.2.M20150204-1700
java.version=1.8.0_60
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.jee.product -keyring /Users/xxxxxxxx/.eclipse_keyring -showlocation
Command-line arguments:  -os macosx -ws cocoa -arch x86_64 -product org.eclipse.epp.package.jee.product -keyring /Users/xxxxxxxx/.eclipse_keyring -showlocation

我已尝试过以下选项:

  • UnZip eclipse最近,从市场安装Testng-然后也观察到同样的问题。
  • UnInstall并重新安装了Java 1.8.0.60,解压缩eclipse,从市场创建了New Workspace和安装的TestNg - 然后也发现了同样的问题。

有人建议有没有其他解决方法或解决方案来解决这个问题,还是Eclipse Luna中的错误? 在此先感谢您的帮助和支持。

1 个答案:

答案 0 :(得分:0)

我找到了解决方法,现在通过执行以下步骤来启动我的TestNG套件。

<强>步骤: 右键单击testng.xml - &gt;选择Run as-&gt;选择运行配置 - &gt;双击TestNg选项 - &gt;浏览套件并从列表中选择相同的testng.xml套件文件。现在单击“运行”按钮,最后我的testng.xml套件即将启动并开始成功运行,没有问题。这种解决方法解决了我的问题。

但是如果我正在查看相同的报告错误(在上面的问题上),如果我正在右键单击相同的testng.xml-&gt;运行as-&gt; TestNg套件。我不知道为什么当我直接进行时,testng套件没有启动,但是当我通过运行配置运行时,同样工作正常。