Gradle build在到达:test任务(junit测试)时失败。它会给出错误
Process 'Gradle Test Executor 1' finished with non-zero exit value 1
我将gradle与Eclipse中的java项目一起使用。分级1.12和Java 7。当在连接到数据库的类上运行测试时,问题似乎会发生。奇怪的是,程序和测试作为java应用程序工作得很好。数据库连接没有问题,它可以正确编译和运行。gradle是否做了一些可能影响它与外部数据库服务器连接的事情?该问题可能与数据库无关,因此任何解决方案都是赞赏的。我在网上和官方网站上都看过了,但没有什么有用的。多谢了。
14:23:28.661 [DEBUG] [TestEventLogger]
14:23:28.661 [DEBUG] [TestEventLogger] Test Run PASSED
14:23:28.665 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':test'
14:23:28.665 [LIFECYCLE] [class org.gradle.TaskExecutionLogger] :test FAILED
14:23:28.665 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :test (Thread[main,5,main]) completed. Took 5.552 secs.
14:23:28.666 [DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] Task worker [Thread[main,5,main]] finished, busy: 6.67 secs, idle: 0.021 secs
14:23:28.808 [LIFECYCLE] [org.gradle.BuildResultLogger]
14:23:28.808 [LIFECYCLE] [org.gradle.BuildResultLogger] BUILD FAILED
14:23:28.808 [LIFECYCLE] [org.gradle.BuildResultLogger]
14:23:28.808 [LIFECYCLE] [org.gradle.BuildResultLogger] Total time: 11.75 secs
14:23:28.811 [DEBUG] [org.gradle.api.internal.tasks.compile.daemon.CompilerDaemonManager] Stopping 0 compiler daemon(s).
错误消息:
Unexpected exception thrown.
org.gradle.messaging.remote.internal.MessageIOException: Could not read message from '/127.0.0.1:51041'.
at org.gradle.messaging.remote.internal.inet.SocketConnection.receive(SocketConnection.java:88)
at org.gradle.messaging.remote.internal.hub.MessageHub$ConnectionReceive.run(MessageHub.java:230)
at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.esotericsoftware.kryo.KryoException: java.io.IOException: An existing connection was forcibly closed by the remote host
at com.esotericsoftware.kryo.io.Input.fill(Input.java:141)
at com.esotericsoftware.kryo.io.Input.require(Input.java:159)
at com.esotericsoftware.kryo.io.Input.readByte(Input.java:255)
at org.gradle.messaging.remote.internal.hub.InterHubMessageSerializer$MessageReader.read(InterHubMessageSerializer.java:64)
at org.gradle.messaging.remote.internal.hub.InterHubMessageSerializer$MessageReader.read(InterHubMessageSerializer.java:53)
at org.gradle.messaging.remote.internal.inet.SocketConnection.receive(SocketConnection.java:83)
... 5 more
Caused by: java.io.IOException: An existing connection was forcibly closed by the remote host
at sun.nio.ch.SocketDispatcher.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
at sun.nio.ch.IOUtil.read(IOUtil.java:192)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:379)
at org.gradle.messaging.remote.internal.inet.SocketConnection$SocketInputStream.read(SocketConnection.java:167)
at com.esotericsoftware.kryo.io.Input.fill(Input.java:139)
... 10 more
Unexpected exception thrown.
org.gradle.messaging.remote.internal.MessageIOException: Could not write message [EndOfStream] to '/127.0.0.1:51041'.
at org.gradle.messaging.remote.internal.inet.SocketConnection.dispatch(SocketConnection.java:115)
at org.gradle.messaging.remote.internal.hub.MessageHub$ConnectionDispatch.run(MessageHub.java:279)
at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: An existing connection was forcibly closed by the remote host
at sun.nio.ch.SocketDispatcher.write0(Native Method)
at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:51)
at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
at sun.nio.ch.IOUtil.write(IOUtil.java:51)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:487)
at org.gradle.messaging.remote.internal.inet.SocketConnection$SocketOutputStream.flush(SocketConnection.java:230)
at org.gradle.messaging.remote.internal.inet.SocketConnection.dispatch(SocketConnection.java:113)
... 5 more
FAILED
尝试使用./gradlew--stop
清理后台进程。对我有用。这是我的错误。而且有时我会在构建结束时得到一个空闲,而且永远不会结束。
* What went wrong:
Execution failed for task ':test'.
> A problem occurred starting process 'Gradle Test Executor 1'
我已经在以下所有链接上试用了该解决方案:Gradle Build Errors Android Studio分级错误-preDexDebug Android java.exe已完成,退出值为非零%1 已完成,退出值为非零 执行任务失败:“:app:PredexDebug” http://fqa.io/questions/29045129/android-java-exe-finished-with
当我键入 在 CentOS 7 终端中调试以使用 gradle 启动此示例Spring启动应用程序时,我收到以下错误。 我搜索了这个错误,并阅读了其他类似但不重复的SO帖子。例如,这是在CentOS 7和web应用程序中的eclipse中。这不是android应用程序等。此外,其他帖子中给出的命令也没有解决这个问题。 重现此问题所需的所有代码都在上面的github链接中,诊断问题的所有日志都在下面
并使用指定的版本生成以下问题: 当gretty插件版本3.0.1被设置时,脚本可以正常工作。知道为什么脚本不兼容吗?
我试着看过类似的,但没有一个解决方案奏效。我以前运行的应用程序没有问题,但我的新应用程序突然开始给我带来问题。当我尝试运行它时,它总是失败: 控制台显示的内容如下:
我遵循了Java中Google Sheets api中的步骤,当我运行“gradle-q run”时,它给出了以下错误: 失败:生成失败,出现异常。 > 错误:任务“:运行”的执行失败。 进程'命令'/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/java"以非零退出值1完成 尝试:使用--stackTrace选项运行以获取堆栈跟踪。使用--info或--
失败:生成失败,出现异常。 出错原因:任务':app:ProcessDebugGoogleServices'执行失败。 这是我在连接到firebase并运行应用程序后得到的错误。