Java TestNG 启动时发生内部错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/34050615/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
TestNG An internal error occurred during launching
提问by Sug
I created a TestNG class (FirstTest.java) and when I run the test case as TestNG Test, I am getting the following error.
我创建了一个 TestNG 类 (FirstTest.java),当我将测试用例作为 TestNG Test 运行时,出现以下错误。
An internal error occurred during: "Launching FirstTest". java.lang.NullPointerException
在“启动 FirstTest”期间发生内部错误。java.lang.NullPointerException
Eclipse Version: Luna Service Release 2 (4.4.2)
Eclipse 版本:Luna 服务版本 2 (4.4.2)
If anyone knows Please Help!
如果有人知道请帮助!
回答by Michael
I encountered a problem with similar symptoms today. I'm not sure if it is the same problem but it matches everything in your question.
我今天遇到了类似症状的问题。我不确定这是否是相同的问题,但它与您问题中的所有内容相匹配。
In my case, the log files said:
就我而言,日志文件说:
!ENTRY org.eclipse.core.jobs 4 2 2015-12-03 15:49:19.369
!MESSAGE An internal error occurred during: "Launching NewTest".
!STACK 0
java.lang.NullPointerException
at org.testng.eclipse.maven.MavenTestNGLaunchConfigurationProvider.getVMArgsFromPom(MavenTestNGLaunchConfigurationProvider.java:74)
So my problem was that the TestNG-plugin in Eclipse failed to find the pom-file, as I don't use Maven. Anyway, after uninstalling the optional M2E (Maven...) part of the TestNG Eclipse plugin I could run my TestNG test cases successfully.
所以我的问题是 Eclipse 中的 TestNG 插件未能找到 pom 文件,因为我不使用 Maven。无论如何,在卸载 TestNG Eclipse 插件的可选 M2E (Maven...) 部分后,我可以成功运行我的 TestNG 测试用例。
If you have the same issue, you uninstall the M2E part in Eclipse by selecting
如果您有同样的问题,您可以通过选择卸载 Eclipse 中的 M2E 部分
- Help
- Install new software...
- What is already installed?
- Select the TestNG M2E software and click uninstall
- 帮助
- 安装新软件...
- 什么已经安装?
- 选择TestNG M2E软件,点击卸载
Hope this helps!
希望这可以帮助!
回答by Rahul Ganjare
I Installed TestNG in Eclipse and tried to execute test case but got error message "Launching Test Case has encountered a problem, an Internal error occur during during launching Test Case "
我在 Eclipse 中安装了 TestNG 并尝试执行测试用例,但收到错误消息“启动测试用例遇到问题,在启动测试用例期间发生内部错误”
i guess TestNG-plugin in Eclipse might failed,i uninstalled optional M2E (Maven...). After uninstalling the optional M2E (Maven...) part of the TestNG Eclipse plugin I could run my TestNG test cases successfully.
我猜 Eclipse 中的 TestNG 插件可能会失败,我卸载了可选的 M2E (Maven ...)。卸载 TestNG Eclipse 插件的可选 M2E (Maven...) 部分后,我可以成功运行我的 TestNG 测试用例。
If you have the same issue, you uninstall the M2E part in Eclipse by selecting
如果您有同样的问题,您可以通过选择卸载 Eclipse 中的 M2E 部分
Help Install new software... What is already installed? Select the TestNG M2E software and click uninstall
帮助 安装新软件... 已经安装了什么?选择TestNG M2E软件,点击卸载
回答by Gobi
Need to uninstall M2E. I uninstalled like below path: Help->Install new software->Already installed -> Uninstall M2E
需要卸载M2E。我按照以下路径卸载:帮助->安装新软件->已安装->卸载M2E
回答by XuQing Tan
回答by user11195305
I was also getting the same issue, I just uninstalled TestNG M2E software.
我也遇到了同样的问题,我刚刚卸载了 TestNG M2E 软件。
Steps:
脚步:
- Help
- Install new software.
- Install/Update.
- Click on Install/Update link (right-hand side)
- Select TestNG M2E from the list.
- Uninstall.
- 帮助
- 安装新软件。
- 安装更新。
- 单击安装/更新链接(右侧)
- 从列表中选择 TestNG M2E。
- 卸载。
回答by Ramankanth Vijayaraman
Hi I faced the same problem. The eclipse failed to initiate the action,
嗨,我遇到了同样的问题。日食未能启动动作,
To solve this problem, follow the below steps
要解决此问题,请按照以下步骤操作
- Go To Help
- Choose Install New Software
- Choose Whats been installed?
- Uninstall the TestNG M2e from the list
- Restart the application
- 去帮助
- 选择安装新软件
- 选择安装了什么?
- 从列表中卸载 TestNG M2e
- 重新启动应用程序