0
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:470)
at org.gradle.internal.remote.internal.inet.SocketConnection$SocketOutputStream.writeWithNonBlockingRetry(SocketConnection.java:259)
at org.gradle.internal.remote.internal.inet.SocketConnection$SocketOutputStream.writeBufferToChannel(SocketConnection.java:247)
at org.gradle.internal.remote.internal.inet.SocketConnection$SocketOutputStream.flush(SocketConnection.java:241)
at org.gradle.internal.remote.internal.inet.SocketConnection.flush(SocketConnection.java:119)
... 22 more
Daemon vm is shutting down... The daemon has exited normally or was terminated in response to a user interrupt.
:bootRun FAILED

我用过

server.connection-timeout=-1 

在 application.properties 但一段时间后它仍然断开连接。

我什至用过

spring.datasource.testWhileIdle=true
spring.datasource.validationQuery=SELECT 1

在 application.properties 但无济于事。我做错了什么?

4

1 回答 1

0

我不得不改变

spring.datasource.testWhileIdle=true
spring.datasource.validationQuery=SELECT 1

spring.datasource.dbcp.test-while-idle=true spring.datasource.dbcp.validation-query=SELECT 1

显然在 springboot 1.4 中进行了重命名。

于 2017-02-13T21:25:03.213 回答