java.lang.NoSuchMethodError 在 Eclipse 中运行 TestNG 测试
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/45280055/
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
java.lang.NoSuchMethodError running TestNG Test in Eclipse
提问by MacNord
I am getting the Exception
我收到异常
FAILED CONFIGURATION: @BeforeSuite arquillianBeforeSuite
java.lang.NoSuchMethodError: org.jboss.remoting3.Endpoint.builder()Lorg/jboss/remoting3/EndpointBuilder;
at org.jboss.as.controller.client.impl.RemotingModelControllerClient.getOrCreateChannel(RemotingModelControllerClient.java:117)
at org.jboss.as.controller.client.impl.RemotingModelControllerClient.getChannel(RemotingModelControllerClient.java:59)
at org.jboss.as.protocol.mgmt.ManagementChannelHandler.executeRequest(ManagementChannelHandler.java:147)
at org.jboss.as.protocol.mgmt.ManagementChannelHandler.executeRequest(ManagementChannelHandler.java:122)
Running Arquillian Tests in Eclipse Oxygen with TestNG and wildfly11. My Maven configuration is as follows:
使用 TestNG 和 wildfly11 在 Eclipse Oxygen 中运行 Arquillian 测试。我的Maven配置如下:
<dependency>
<groupId>org.jboss.arquillian.testng</groupId>
<artifactId>arquillian-testng-container</artifactId>
<version>1.1.13.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.11</version>
</dependency>
<dependency>
<groupId>org.wildfly.arquillian</groupId>
<artifactId>wildfly-arquillian-container-managed</artifactId>
<version>2.0.1.Final</version>
<scope>test</scope>
</dependency>
回答by Atul Sharma
I also had the same issue. I tried the below solution and it worked for me like a charm. The Solution was:
我也有同样的问题。我尝试了以下解决方案,它对我很有用。解决方案是:
Adding the TestNG Library into the project. Steps are:
将 TestNG 库添加到项目中。步骤是:
- Right Click on the Project
- Build Path
- Configure Build Path
- Libraries (Tab)
- Go to "Add Library" and click the button.
- Add the 'TestNG' Library and click Ok/Next.
- TestNG Library will be added to your project.
- 右键单击项目
- 构建路径
- 配置构建路径
- 库(选项卡)
- 转到“添加库”并单击按钮。
- 添加“TestNG”库,然后单击“确定”/“下一步”。
- TestNG 库将被添加到您的项目中。
Try Running again, it will work.
再次尝试运行,它会起作用。
Note: I was using Java1.8 Library (had to update it from java1.5 as my eclipse create the project with default 1.5).
注意:我使用的是 Java1.8 库(必须从 java1.5 更新它,因为我的 Eclipse 使用默认 1.5 创建项目)。
回答by k sarath
Even I have faced the same issue when I was about to use the latest version of TestNG, but downgrading to a lower version of TestNG resolved the problem.
即使我在即将使用最新版本的 TestNG 时也遇到了同样的问题,但降级到较低版本的 TestNG 解决了该问题。
回答by MacNord
The Solution was:
解决方案是:
remove the the Wildfly 11 Runtime from the Classpath.
从类路径中删除 Wildfly 11 运行时。
- Right Click on the Project
- Build Path
- Configure Build Path
- Libraries (Tab)
- remove Wildfly 11 Runtime (or Wildfly 10 Runtime)
- 右键单击项目
- 构建路径
- 配置构建路径
- 库(选项卡)
- 删除 Wildfly 11 运行时(或 Wildfly 10 运行时)
Why is this necessary? Comments welcome...
为什么这是必要的?欢迎评论...