Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Springboot properties is not able to resolve global properties

New member
Joined
Feb 9, 2023
Messages
8
I have a below properties in my spring boot application.properties

qs.cloud.region=${awsRegion}

I am using ubuntu and tried below in terminal.

export awsRegion=ap-southeast-1

When I did echo $awsRegion I am able to get the value in terminal

But when start my spring boot application I am getting

Could not resolve placeholder 'awsRegion' in value "${awsRegion}"
Please help me on this.
 
New member
Joined
Feb 9, 2023
Messages
8
First: Environment variables are case-sensitive. By convention, but not rule, environment variable names are always capitalized.

Second: export is a command Bash that used to set a variable. The variable will be visible only for any subprocesses started from that instance of Bash.

Third: To make it more permanent, you can add it to your shell configuration file: $HOME/.bashrc or more globally in /etc/environment.
For example, AWS_REGION=ap-southeast-1
After adding this line, the changes won't reflect instantly in GUI-based systems. You have to exit the terminal or create a new one and on the server, log out the session and log in to reflect these changes.
 
Top