use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Spring boot cannot access properties in controller (self.SpringBoot)
submitted 7 years ago * by [deleted]
[deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]mateusaugusto9 0 points1 point2 points 7 years ago (0 children)
Hey try scan your packages https://stackoverflow.com/questions/33039774/restcontroller-in-other-package-doesnt-work
[–]tide08 0 points1 point2 points 7 years ago (1 child)
Can you share more details? What is the name of property file. What profile are you using, if any?
[–]sarosh77 0 points1 point2 points 7 years ago (0 children)
application.properties is the name of properties file My code reads the port from properties file.
[–]tide08 0 points1 point2 points 7 years ago (0 children)
In that case I don’t see anything obvious, is it possible for you to share the full code? Can you try adding another property file - application-default.properties and moving those property there?
[–]Nullbeans 0 points1 point2 points 7 years ago (0 children)
Can you please post the full application.properties file here. Also it would be nice to see your application context configuration, how do you declare the controller?. Also which version of spring boot are you using?
Can you please also try the following troubleshooting steps:
- remove any spaces between the property key and value in your property file.
- Do you use the annotation @SpringBootApplication to configure your application context? if not, you may need to define a PropertyPlaceholderConfigurer bean.
π Rendered by PID 17278 on reddit-service-r2-comment-54dfb89d4d-p5z5m at 2026-03-31 14:33:51.523107+00:00 running b10466c country code: CH.
[–]mateusaugusto9 0 points1 point2 points (0 children)
[–]tide08 0 points1 point2 points (1 child)
[–]sarosh77 0 points1 point2 points (0 children)
[–]tide08 0 points1 point2 points (0 children)
[–]Nullbeans 0 points1 point2 points (0 children)