Surrogate module execution problem: @Autowired Set<Class<? extends Exception>>

27 views
Skip to first unread message

Christian Poirier

unread,
May 11, 2018, 9:05:00 AM5/11/18
to CAS Community
Hi

Look at the error I receive when I start CAS after I add the Surrogate module:


2018-05-10 14:58:34,029 ERROR [org.springframework.boot.SpringApplication] - <Application startup failed>
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'surrogateAuthenticationWebflowConfiguration': Unsatisfied dependency expressed through field 
'handledAuthenticationExceptions'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'java.util.Set<java.lang.Class<java.lang.Ex
ception>>' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true), @org.sp
ringframework.beans.factory.annotation.Qualifier(value=handledAuthenticationExceptions)}
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588) ~[spring-beans-4.3.14
.RELEASE.jar:4.3.14.RELEASE]

The code causing the problem is the following lines and it is in then SurrogateAuthenticationWebFlowConfiguration.java:
@Autowired
@Qualifier("handledAuthenticationExceptions")
private Set<Class<? extends Exception>> handledAuthenticationExceptions;




As I am a newbie in Java and Spring, what to do to correct this?


Thanks in advance

Christian Poirier

unread,
May 15, 2018, 9:19:33 AM5/15/18
to CAS Community
I did a workaround by making a change to handledAuthenticationExceptions and the @PostConstruct init() method.
    //@Autowired
    //@Qualifier("handledAuthenticationExceptions")
    private Set<Class<? extends Exception>> handledAuthenticationExceptions;

    @PostConstruct
    public void init() {
        this.handledAuthenticationExceptions = new HashSet<Class<? extends Exception>>();
        this.handledAuthenticationExceptions.add(SurrogateAuthenticationException.class);
    }


Reply all
Reply to author
Forward
0 new messages