spring boot app not launching on Azure Linux VM

Viewed 19

I have a spring boot app that is running well on AWS Linux VM. Now, I am trying to run it on Azure Linux VM.

I am launching the application using this command (just like I am doing on AWS):

java -Dspring.profiles.active=prod -jar /home/azureuser/myapp/myapp-server.jar

But nothing happens after this. It doesn't exit but there is no output/log message at all. Ideally, I should see output generated on the shell but it prints nothing. There is no error/exception stack trace.

The same jar is working fine on AWS Linux VM.

The only difference in my AWS and Azure VMs is that on AWS, I have Java 16:

openjdk version "16.0.2" 2021-07-20
OpenJDK Runtime Environment Corretto-16.0.2.7.1 (build 16.0.2+7)
OpenJDK 64-Bit Server VM Corretto-16.0.2.7.1 (build 16.0.2+7, mixed mode, sharing)

while on Azure VM, I have Java 17:

openjdk version "17.0.4.1" 2022-08-12 LTS
OpenJDK Runtime Environment Microsoft-40354 (build 17.0.4.1+1-LTS)
OpenJDK 64-Bit Server VM Microsoft-40354 (build 17.0.4.1+1-LTS, mixed mode, sharing)

But I have tested the jar on my local windows machine on Java 17 and it works fine.

Any idea what might be the issue? Is the output going somewhere else that I don't know about?

1 Answers

It is working. I launched the application and then got busy with something else. When I checked back on the window after 10-15 minutes, I saw the output.

The issue was that Azure VM is a lot slower/underpowered than AWS VM. Since the app starts up in a few seconds on AWS, I never imagined that it would be that slow on Azure. It is taking more than one minute for the first line of output to show and more than 5 minutes for the app to finish start up.

Related