duplicate filter registration for 'springsecurityfilterchain' spring boot

Ads
 

duplicate filter registration for 'springsecurityfilterchain' spring boot

Hi,

I have spring boot application and i am deploying the war file on tomcat. Now application does not start and gives:

duplicate filter registration for 'springsecurityfilterchain' spring boot

Error on the boot time.

How to resolve this?

Thanks

View Answers

December 14, 2018 at 12:23 AM

Hi,

This error comes when anyhow AbstractSecurityWebApplicationInitializer is configure twice in your application.

In one of the we were extending the AbstractSecurityWebApplicationInitializer class and not using extended class anywhere. In this scenario ''springSecurityFilterChain'' was reinitializing.

So, we removed the class which was extending AbstractSecurityWebApplicationInitializer and the application issue resolved.

thanks


December 14, 2018 at 12:25 AM

Hi,

If you use Spring Boot then you wont need to initialise AbstractSecurityWebApplicationInitializer .

So, if your application is using the class AbstractSecurityWebApplicationInitializer then simply delete the class which is extending the class AbstractSecurityWebApplicationInitializer .

And this way problem will go away.

Thanks


December 14, 2018 at 12:28 AM

Hi,

This is the error which is coming in Spring Boot application:

Caused by: java.lang.IllegalStateException: Duplicate Filter registration for 'springSecurityFilterChain'. Check to ensure the Filter is only configured once.
    at org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer.registerFilter(AbstractSecurityWebApplicationInitializer.java:217)
    at org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer.insertSpringSecurityFilterChain(AbstractSecurityWebApplicationInitializer.java:151)
    at org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer.onStartup(AbstractSecurityWebApplicationInitializer.java:124)
    at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:172)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5244)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
    ... 42 more

Thanks

Ads









Related Tutorials/Questions & Answers:
Spring Duplicate submit - Spring
Spring Duplicate submit  hi, i have problem in spring, i am pressing back or refresh my request get submitted again what i can do to avoid this,i am using only spring not struts
Spring MVC User Registration example
Spring MVC User Registration example  hi, I am unable to find springMVCUserRegistration example full code can u send me full code of this example   Please visit the following link: Spring MVC USer Registration
Advertisements
Form with a search filter in spring mvc?
Form with a search filter in spring mvc?  Hi I am new to Spring MVC, I have created a spring project which is displaying the list from database... filter where I need to search by transaction id which is one of the field
Form with a search filter in spring mvc?
Form with a search filter in spring mvc?  Hi I am new to Spring MVC, I have created a spring project which is displaying the list from database... filter where I need to search by transaction id which is one of the field
Version of org.springframework.boot>spring-boot-starters dependency
List of Version of org.springframework.boot>spring-boot-starters dependency
Version of co.paralleluniverse>comsat-spring-boot dependency
List of Version of co.paralleluniverse>comsat-spring-boot dependency
Version of com.fintonic>versioning-spring-boot dependency
List of Version of com.fintonic>versioning-spring-boot dependency
Version of com.piggsoft>beetl-spring-boot dependency
List of Version of com.piggsoft>beetl-spring-boot dependency
Version of com.replash>replash-spring-boot dependency
List of Version of com.replash>replash-spring-boot dependency
Version of com.restapijs>restapijs-spring-boot dependency
List of Version of com.restapijs>restapijs-spring-boot dependency
Version of com.roncoo>roncoo-spring-boot dependency
List of Version of com.roncoo>roncoo-spring-boot dependency
Version of com.ruijc>spring-boot-parent dependency
List of Version of com.ruijc>spring-boot-parent dependency
Version of cn.kxlove>spring-boot-beetl dependency
List of Version of cn.kxlove>spring-boot-beetl dependency
Struts Hibernate Spring - Login and User Registration - Hibernate
/hibernate-spring/index. shtml) but the problem is that Registration doesn't register.... http://www.roseindia.net/struts/hibernate-spring/user-registration-form.shtml...Struts Hibernate Spring - Login and User Registration  Hi All, I
Version of org.springframework.boot>spring-boot-starter-parent dependency
List of Version of org.springframework.boot>spring-boot-starter-parent dependency
Version of co.paralleluniverse>comsat-spring-boot-security dependency
List of Version of co.paralleluniverse>comsat-spring-boot-security dependency
Version of com.baomidou>mybatisplus-spring-boot-starter dependency
List of Version of com.baomidou>mybatisplus-spring-boot-starter dependency
Version of com.cjoop>spring-boot-starter-tenant dependency
List of Version of com.cjoop>spring-boot-starter-tenant dependency
Version of com.cjoop>spring-boot-starter-dubbox dependency
List of Version of com.cjoop>spring-boot-starter-dubbox dependency
Version of com.clianz>cloudant-spring-boot-starter dependency
List of Version of com.clianz>cloudant-spring-boot-starter dependency
Version of com.cuisongliu>druid-spring-boot-autoconfigure dependency
List of Version of com.cuisongliu>druid-spring-boot-autoconfigure dependency
Version of com.cuisongliu>druid-spring-boot-starter dependency
List of Version of com.cuisongliu>druid-spring-boot-starter dependency
Version of com.cuisongliu>orderbyhelper-spring-boot-autoconfigure dependency
List of Version of com.cuisongliu>orderbyhelper-spring-boot-autoconfigure dependency
Version of com.cuisongliu>orderbyhelper-spring-boot-starter dependency
List of Version of com.cuisongliu>orderbyhelper-spring-boot-starter dependency
Version of com.devbury>spring-boot-starter-threadscope dependency
List of Version of com.devbury>spring-boot-starter-threadscope dependency
Version of com.fintonic>versioning-spring-boot-parent dependency
List of Version of com.fintonic>versioning-spring-boot-parent dependency
Version of com.fintonic>versioning-spring-boot-starter dependency
List of Version of com.fintonic>versioning-spring-boot-starter dependency
Version of com.merapar>spring-boot-starter-graphql dependency
List of Version of com.merapar>spring-boot-starter-graphql dependency
Version of com.moelholm>prometheus-spring-boot-starter dependency
List of Version of com.moelholm>prometheus-spring-boot-starter dependency
Version of com.rivescript>rivescript-spring-boot-starter dependency
List of Version of com.rivescript>rivescript-spring-boot-starter dependency
Version of com.roncoo>roncoo-spring-boot-starters dependency
List of Version of com.roncoo>roncoo-spring-boot-starters dependency

Ads