# Why I get a UnsatisfiedDependencyException when using environmental variable JWT\_SECRET in spring boot application?

**URL:** <https://forum.codewithmosh.com/t/why-i-get-a-unsatisfieddependencyexception-when-using-environmental-variable-jwt-secret-in-spring-boot-application/72270>\
**Category:** Uncategorized\
**Created:** [February 15, 2026, 8:36am UTC](https://forum.codewithmosh.com/t/why-i-get-a-unsatisfieddependencyexception-when-using-environmental-variable-jwt-secret-in-spring-boot-application/72270 "2026-02-15T08:36:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![a.madhu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/a.madhu/32/6830_2.png) [@a.madhu](https://forum.codewithmosh.com/u/a.madhu)\
**Post date:** [February 15, 2026, 8:36am UTC](https://forum.codewithmosh.com/t/why-i-get-a-unsatisfieddependencyexception-when-using-environmental-variable-jwt-secret-in-spring-boot-application/72270/1 "2026-02-15T08:36:30Z")

</div>

I already delcared AuthContreller is RestController, all Beans are decleard but why we get a error ?  
wehen we use application.yaml we dont have any errors but when we use Environmental variables I get a error ?

 ![Screenshot (285)](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/2X/1/101b8c4036b0f05be2faccb3b1e620d9e4146535.png)

 ![Screenshot (283)](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/2X/4/4d7c856643d0a9c13b006b17e7f052adb2436f81.png)

 ![Screenshot (282)](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/2X/a/a3d980b4634c7193506308fcb34007f32d1f7314.png)
