Skip to content

Tag: spring-boot

How to wire classes and objects in SpringBoot

Have SpringBoot Java app with different classes. I am not able to inject the dependencies and initialize/access the object of one class into another . Have seen the spring doc and used the annotations (@component,@Autowired etc. ), still there is an issue. following are the classes. Main Class () Controller c…

Spring Boot merge configuration properties

I’ve a use case where I need to bind configuration properties based on two prefixes, one of which is determined at runtime. Let’s say the constant prefix is foo and the runtime prefix is bar. Given a new instance of Java Bean class FooBar, the code should bind all environment variables FOO_, then …

Spring Boot @Schedular not running after first execution

I have written this scheduled task in my SpringBoot app: This runs first time, but not subsequently. Answer It turned out that I was running another “heavy” scheduled task in the same application (it was initially created for testing my business logic and then I forgot to remove that). When I remo…