ali-bouali / spring-boot-3-jwt-security

Sample project on how to implement JWT security based using Spring boot 3 and Spring security 6
https://aliboucoding.com/p/securing-your-spring-boot-3-0-applications-with-json-web-tokens-jwt
Apache License 2.0
1.87k stars 873 forks source link

Error creating bean #44

Open cherifkasse opened 1 year ago

cherifkasse commented 1 year ago

Hello ! Can u help me i have this error: Error creating bean with name 'jwtAuthenticationFilter' defined in file [F:\javadev1\SunuBtrust360_Enrol\target\classes\com\SunuBtrust360_Enrol\config\JwtAuthenticationFilter.class]: Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'jwtService': Injection of autowired dependencies failed

ak774411 commented 1 year ago

It relate to the jpa start up, you need to create a postgresql on your localhost and set the config in application.yml

kavyabala23 commented 1 year ago

I too have the same error.I have created a database in my localhost but i also got that error

iozyigit0 commented 1 year ago

this could be configuration problem that Lombok is not accepting. Can you remove @RequiredArgsConstructure and use Autowirde for the dependencies, just to understand if problem is database or Lombok.

@Autowired
private final JwtService jwtService;

@Autowired
private final UserDetailsService userDetailsService;

@Autowired
private final TokenRepository tokenRepository;
Danc-0 commented 12 months ago

I had also faced a similar challenge and for my case I had duplicated the relationships of my table and thus creation was quite of a challenge thus resulting to this.

Maybe check on your DB configuration and your entities.

ihebwp commented 5 months ago

regarding the jwtfilter exception "error creating bean" : i configure the properties/connection port to 5432 and Username to postgres same into application-de.yml worked for me //