3

I'm running a web app using Spring Boot (1.5.8.RELEASE, embedded tomcat) on Ubuntu 16.04 (OpenJDK 1.8.0_151). Server is started with this command:

java -jar -Dspring.profiles.active=local -Dserver.port=8090 target/abc.jar > /dev/null 2>&1 &

Here, "target" is the directory which has the latest jar to run. During deployments, while the server is running, the content of "target" is moved to a directory "old_target" (mv target old_target), and the new jar is copied in "target" directory. At this point, the server completely stops responding to any request. Output of curl:

curl --max-time 60 --connect-timeout 2 localhost:8090/health : curl: (28) Operation timed out after 60001 milliseconds with 0 bytes received

So it's definitely listening on the port (can verify this from netstat as well) but does not respond at all. What could be wrong? My understanding was that once the JVM loads the jar content in memory, we can delete/modify the jar file on disk without it affecting the currently running application. But that doesn't seem to be the case here.

The server is in this hung state right now and I can execute any commands which may help in identifying the issue.

Shubham
  • 780
  • 3
  • 13
  • 32
  • `once the JVM loads the jar content in memory, we can delete/modify the jar file on disk without it affecting the currently running application.` While that doesn't seem is the source of your problems, this is [not necessarily true](https://stackoverflow.com/questions/31027000/does-jvm-load-all-the-classes-mentioned-by-the-classpath). I suggest you reconsider your deployment strategy. – icyrock.com Feb 03 '18 at 22:02

0 Answers0