Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Boot Application Hanging When Running on Command Line

I have a Spring Boot app that can not be run with a .yml config file.Below is the command that I run:

java -jar /opt/myAppFolder/myApp.war

I have a config folder withing the same location that I run my war file. And in that config,I have a application.yml file that application needs to retrieve some config:

security:
  user:
  password: password
logging:
  level:
     org.springframework.security: DEBUG
release:
  sourceDir: /$ANY_DIR
  targetDir: /$ANY_DIR
users:
  - name: $ANY_NAME
    pwd : $ANY_NAME
  - name: $ANY_NAME
    pwd : $ANY_NAME

mail:
  host: $ANY_NAME
  recipients: $ANY_NAME
  subject: $ANY_NAME
  body: $ANY_NAME

server:
    port: 9000
spring:
  profiles:
    active: prod

Problem: Once I run the app on command line,the process just hangs.No output,no logging. I have tried to enable debug via command line. No avail.

If I put a file with properties extension,it works.However I want to use .yml since it is more convenient for me to have list of dynamic properties.And why nothing is displayed anway?

Any help appreciated.

Spring Boot Version:1.5.7

OS Version:Ubuntu 3.13.0-24-generic

like image 983
selman Avatar asked Feb 01 '26 05:02

selman


1 Answers

Finally resolved it.

So here is the story:

I have contacted Spring Boot Team and they have recommended me to upgrade to version 1.5.8.RELEASE.

Once I did that,I had a different issue;application was not hanging anymore,but shutting down without logging anything. And eventually it turned out to be an error in my logback-spring.xml file. It was malformatted.And in its "prod" profile,I did not have any console appender.Hence no output visible. So I have fixed my file and it started working.

More on my communication with Spring Boot Team:

https://github.com/spring-projects/spring-boot/issues/10711

like image 123
selman Avatar answered Feb 02 '26 19:02

selman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!