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

I have used

server.connection-timeout=-1 

in application.properties but it still disconnects after some time.

I even used

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

in application.properties but to no avail. What I'm I doing wrong?

Rbk
  • 72
  • 1
  • 11
  • This seems to be Gradle related. Do you experience the same symptoms if you run your app's JAR file? with `java -jar ...`? – Strelok Feb 13 '17 at 12:20
  • i have not tried that,but I highly doubt that's the issue.I'll give it a try and see. – Rbk Feb 13 '17 at 14:45
  • Do you have any proof that this is a DB connection related issue ? if not, try checking the code for file reading, and catch the java.io.IOException on file reading part. it may help. – Suraj Muraleedharan Feb 13 '17 at 11:21

1 Answers1

0

I had to change

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

to

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

Apparently there had been a renaming in springboot 1.4.

Rbk
  • 72
  • 1
  • 11