最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

No qualifying bean of type 'com.mycom.idp.common.servlet.IdpSecurityAdapter' available, after spring boot upgrad

programmeradmin8浏览0评论

At the time of running JUnits, below error appears

Caused by: .springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.mycom.idpmon.servlet.IdpSecurityAdapter' available
    at .springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:373)
    at .springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:364)
    at .springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1290)
    at com.mycom.config.SecurityConfiguration.<init>(SecurityConfiguration.java:24)
    at com.mycom.config.SecurityConfiguration$$SpringCGLIB$$0.<init>(<generated>)
    at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
    at .springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:209)
    ... 48 more

SecurityConfiguration.java class looks like this,

@Configuration
@EnableWebSecurity
@Order(1)
public class SecurityConfiguration {
    ApplicationContext ctx;
    IdpSecurityAdapter idpSecurityAdapter;

    public SecurityConfiguration(ApplicationContext ctx) {
        this.ctx = ctx;
        this.idpSecurityAdapter = ctx.getBean(IdpSecurityAdapter.class);
    }

Error is pointing at SecurityConfiguration.java line 24, which is

this.idpSecurityAdapter = ctx.getBean(IdpSecurityAdapter.class);

At the time of making build this error appears,

java.lang.IllegalStateException: ApplicationContext failure threshold (1) exceeded

Could you please suggest what should changes should I make to make it compatible with spring boot 3.4.3?

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论