Skip to content

Heroku deployment error “required a bean of type ‘’ that could not be found.”

I am trying to deploy my springboot app to heroku but I am getting an error that it cannot find a JwtDecoder bean. I have tried googling it a bit but can’t find anything that helps. Everything works fine locally, just not when deployed to heroku.

Here is my heroku log –tail:

2021-02-27T20:18:45.134160+00:00 app[web.1]: ***************************
2021-02-27T20:18:45.134160+00:00 app[web.1]: APPLICATION FAILED TO START
2021-02-27T20:18:45.134160+00:00 app[web.1]: ***************************
2021-02-27T20:18:45.134161+00:00 app[web.1]:
2021-02-27T20:18:45.134161+00:00 app[web.1]: Description:
2021-02-27T20:18:45.134161+00:00 app[web.1]:
2021-02-27T20:18:45.134179+00:00 app[web.1]: Method springSecurityFilterChain in 
required a bean of type '' that 
could not be found.
2021-02-27T20:18:45.134179+00:00 app[web.1]: 
2021-02-27T20:18:45.134179+00:00 app[web.1]:
2021-02-27T20:18:45.134180+00:00 app[web.1]: Action:
2021-02-27T20:18:45.134180+00:00 app[web.1]:
2021-02-27T20:18:45.134181+00:00 app[web.1]: Consider defining a bean of type 
'' in your configuration.


public class WebSecurityConfig extends WebSecurityConfigurerAdapter {

    protected void configure(HttpSecurity http) throws Exception{

I’m not sure what else to include… Feel free to comment on what else I should add. Or, the repo is at

Thank you in advance for any help you may be able to provide!


It cannot find because you listed that dependency as test scope


enter image description here

Change the scope or just remove that entry. Default entry is compile.