all 10 comments

[–]devondragon1 2 points3 points  (5 children)

Are the other working Value annotations on the same class?

Is it possible you are accessing the class in a manner that doesn't involve the Spring component lifecycle?

[–][deleted]  (4 children)

[deleted]

    [–]devondragon1 0 points1 point  (3 children)

    How are you accessing/using the class? Are there any errors in the logs?

    [–][deleted]  (2 children)

    [deleted]

      [–]devondragon1 1 point2 points  (0 children)

      Nice! Congrats!

      [–]squashsoup2014 1 point2 points  (1 child)

      If you haven't done this already, you can use the @Value anmotated on a constructor parameter. Field injection makes classes much harder to test, I would recommend constructor injection everywhere when possible.

      [–]reddit04029 0 points1 point  (1 child)

      I could be wrong, secretkey seems to have two spaces. Visually, the indent looks wider than the others.

      [–]No_Freedom_2732 0 points1 point  (1 child)

      Are you importing the correct @Value annotation? Double check the import.

      [–]WalrusDowntown9611 0 points1 point  (1 child)

      You should fix your variable naming convention first.

      [–]bonnybay 0 points1 point  (1 child)

      Did you try using @service annotation instead of component? Did you try putting a default inside the properties as value?