Skip to content
Advertisement

Static variable set to null by @Value

My Constants File:

JavaScript

My settings.properties:

JavaScript

My Referring Class and Method:

JavaScript

But Root Domain is coming as null

[update] My spring-master.xml

JavaScript

And the ApplicationContextProvider class is as follows:

JavaScript

So yes the files are in classpath

Advertisement

Answer

@Value() gets called on the initialization of the bean , the bean gets initialized on need not on the startup so you will not have the value unless the bean is initialized

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement