admin管理员组

文章数量:1567016

在整合springsecurity时候

package com.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration;

@Configuration
public class SpringSecurity extends WebSecurityConfiguration{
}

继承 WebSecurityConfiguration之后点击项目启动报错

Description:

  • The bean 'delegatingApplicationListener', defined in org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration, could not be registered. A bean with that name has already been defined in class path resource [com/config/SpringSecurity.class] and overriding is disabled.

Action:

Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true

原因:

在启动项目时,createRestApi这个Bean已经存在,不能被注册。导致启动失败。 

解决方法:

添加

spring:
    main:
      allow-bean-definition-overriding: true

 

 

本文标签: enablingoverridingrenamingbeansMain