[英]AssertJ no such method error when building locally
I'm having an issue during local build of a multi-module project. 在本地构建多模块项目期间遇到问题。
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.118
sec <<< FAILURE! - in org.end2end.ClientEnd2EndIT
org.end2end.ClientEnd2EndIT Time elapsed: 0.118 sec <<< ERROR!
java.lang.NoSuchMethodError:
org.assertj.core.util.Throwables.
appendStackTraceInCurrentThreadToThrowable
Exactily when executing this instruction in setupClass method of the test: 正是在测试的setupClass方法中执行此指令时:
frame = GuiActionRunner.execute(() -> GUI.createGui(false));
Where GuiActionRunner.execute() is a method of AssertJ dependency. 其中GuiActionRunner.execute()是AssertJ依赖项的方法。 In the same project I'm building the Client before the End2End module and this instruction is executed even in client's integration tests but in that case the NoSuchMethodError does not take place.
在同一项目中,我正在End2End模块之前构建Client,并且即使在客户端的集成测试中也要执行此指令,但在这种情况下不会发生NoSuchMethodError。 I would specify that if I build under a macOS system or on Travis-ci (both linux and mac builds) this problem does not appears.
我要指定的是,如果我在macOS系统下或Travis-ci(Linux和Mac构建)上进行构建,则不会出现此问题。 This seems to be just a local problem (I'm using linux Mint 18.2).
这似乎只是一个本地问题(我使用的是Linux Mint 18.2)。 Can anyone help?
有人可以帮忙吗?
Solved. 解决了。 The problem was an hidden headless exception thrown while creating the jframe, and this was due to the fact that I was calling:
问题是在创建jframe时抛出了一个无头的隐藏异常,这是由于我在调用以下事实:
SpringApplicationBuilder builder = new
SpringApplicationBuilder(ServerApplication.class);
builder.run(new String[] { "--server.port=9999" });
I solved by adding: 我通过添加解决:
SpringApplicationBuilder builder = new SpringApplicationBuilder(ServerApplication.class);
builder.headless(false); //this line
builder.run(new String[] { "--server.port=9999" });
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.