SecurityContextService defined two times?
Hi,
While starting up my local app and using EnableSecurityMongo annotation I'm getting this error:
***************************
APPLICATION FAILED TO START
***************************
Description:
The bean 'securityContextService', defined in class path resource [uk/co/caeldev/springsecuritymongo/config/MongoConfiguration$SpringSecurityConfiguration.class], could not be registered. A bean with that name has already been defined in URL [jar:file:/home/lukaszg/.m2/repository/uk/co/caeldev/spring-security-mongo/3.0.2/spring-security-mongo-3.0.2.jar!/uk/co/caeldev/springsecuritymongo/services/SecurityContextService.class] and overriding is disabled.
Action:
Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true
I've noticed you are defining SecurityContext service in two manners at once:
@Bean
public SecurityContextService securityContextService() {
return new SecurityContextService();
}
and by annotating this class with Component annotation...
Any ideas?
Thanks in advance
Hello,
I see you might be write. Depending on the spring version that config might be new. I would try by adding the config to your yml or property file and see if you still get that error.
In the meantime I will remove the annotation. No point of having it.
Cheers,
:+1:
having the same issue im using the version 3.0.2 how can i fix i? thanks