java.lang.RuntimeException: java.lang.IllegalStateException: Duplicate Filter registration for 'multipartFilter'. Check to ensure the Filter is only configured once.

JBoss Issue Tracker | Stuart Douglas | 5 months ago
  1. 0

    When deployed attached "ugspa.war" into EAP 7.0.0 GA, error shows: ~~~ 2016-06-23 08:53:11,036 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 76) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./ugspa: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./ugspa: java.lang.RuntimeException: java.lang.IllegalStateException: Duplicate Filter registration for 'multipartFilter'. Check to ensure the Filter is only configured once. at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:85) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) at org.jboss.threads.JBossThread.run(JBossThread.java:320) Caused by: java.lang.RuntimeException: java.lang.IllegalStateException: Duplicate Filter registration for 'multipartFilter'. Check to ensure the Filter is only configured once. at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:231) at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:100) at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82) ... 6 more Caused by: java.lang.IllegalStateException: Duplicate Filter registration for 'multipartFilter'. Check to ensure the Filter is only configured once. at org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer.registerFilter(AbstractSecurityWebApplicationInitializer.java:216) at org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer.registerFilters(AbstractSecurityWebApplicationInitializer.java:198) at org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer.insertFilters(AbstractSecurityWebApplicationInitializer.java:162) at sg.edu.nus.ugspa.config.security.SecurityWebApplicationInitializer.beforeSpringSecurityFilterChain(SecurityWebApplicationInitializer.java:11) at org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer.onStartup(AbstractSecurityWebApplicationInitializer.java:112) at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:175) at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:184) ... 8 more ---And if deploy again--- 2016-06-23 09:30:30,819 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 136) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./ugspa: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./ugspa: java.lang.RuntimeException: java.lang.NullPointerException at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:85) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) at org.jboss.threads.JBossThread.run(JBossThread.java:320) Caused by: java.lang.RuntimeException: java.lang.NullPointerException at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:231) at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:100) at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82) ... 6 more Caused by: java.lang.NullPointerException at sg.edu.nus.ugspa.config.web.WebApplicationInitializer.onStartup(WebApplicationInitializer.java:43) at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:175) at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:184) ... 8 more ~~~

    JBoss Issue Tracker | 5 months ago | Stuart Douglas
    java.lang.RuntimeException: java.lang.IllegalStateException: Duplicate Filter registration for 'multipartFilter'. Check to ensure the Filter is only configured once.
  2. 0

    org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/mmasgis]]

    Stack Overflow | 3 years ago | arpho
    org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/mmasgis]]
  3. 0

    SEC-3174: Combine Spring Security Test and MockMVC throws IllegalStateException

    GitHub | 12 months ago | spring-issuemaster
    java.lang.IllegalStateException: springSecurityFilterChain cannot be null. Ensure a Bean with the name springSecurityFilterChain implementing Filter is present or inject the Filter to be used.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    I try to write a unit test for a controller in Spring MVC, involving Spring Security. For isolation purpose, I need to mock the service present in a Rest controller. To do this, I use this piece of code: {code:java} @RunWith(SpringJUnit4ClassRunner.class) @SpringApplicationConfiguration(classes = EasyCook.class) @WebIntegrationTest public class RecipesControllerCan { @Mock private RecipesService recipesService; @InjectMocks private RecipesController controller; @Autowired private WebApplicationContext wac; @Before public void startMocks(){ controller = wac.getBean(RecipesController.class); MockMvc mockMvc = MockMvcBuilders .standaloneSetup(controller) .alwaysDo(print()) .apply(SecurityMockMvcConfigurers.springSecurity()) .build(); MockitoAnnotations.initMocks(this); } @Test public void testMe(){ } } {code} This leads to this result: java.lang.IllegalStateException: springSecurityFilterChain cannot be null. Ensure a Bean with the name springSecurityFilterChain implementing Filter is present or inject the Filter to be used. at org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurer.beforeMockMvcCreated(SecurityMockMvcConfigurer.java:62) at org.springframework.test.web.servlet.setup.AbstractMockMvcBuilder.build(AbstractMockMvcBuilder.java:133) at fr.easycompany.easycook.springboot.controllers.RecipesControllerCan.startMocks(RecipesControllerCan.java:51) For more details, I joined the project simplified as much as possible to reproduce the issue.

    Spring JIRA | 12 months ago | RĂ©mi Doolaeghe
    java.lang.IllegalStateException: springSecurityFilterChain cannot be null. Ensure a Bean with the name springSecurityFilterChain implementing Filter is present or inject the Filter to be used.
  6. 0

    MockMvc and Spring Security - Null FilterChainProxy

    Stack Overflow | 1 year ago | Senpai
    java.lang.IllegalStateException: springSecurityFilterChain cannot be null. Ensure a Bean with the name springSecurityFilterChain implementing Filter is present or inject the Filter to be used.

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalStateException

      Duplicate Filter registration for 'multipartFilter'. Check to ensure the Filter is only configured once.

      at org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer.registerFilter()
    2. Spring Security
      AbstractSecurityWebApplicationInitializer.insertFilters
      1. org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer.registerFilter(AbstractSecurityWebApplicationInitializer.java:216)
      2. org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer.registerFilters(AbstractSecurityWebApplicationInitializer.java:198)
      3. org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer.insertFilters(AbstractSecurityWebApplicationInitializer.java:162)
      3 frames
    3. sg.edu.nus
      SecurityWebApplicationInitializer.beforeSpringSecurityFilterChain
      1. sg.edu.nus.ugspa.config.security.SecurityWebApplicationInitializer.beforeSpringSecurityFilterChain(SecurityWebApplicationInitializer.java:11)
      1 frame
    4. Spring Security
      AbstractSecurityWebApplicationInitializer.onStartup
      1. org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer.onStartup(AbstractSecurityWebApplicationInitializer.java:112)
      1 frame
    5. Spring
      SpringServletContainerInitializer.onStartup
      1. org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:175)
      1 frame
    6. Undertow Servlet
      DeploymentManagerImpl.deploy
      1. io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:184)
      1 frame
    7. WildFly: Undertow
      UndertowDeploymentService$1.run
      1. org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:100)
      2. org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)
      2 frames
    8. Java RT
      Thread.run
      1. java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      2. java.util.concurrent.FutureTask.run(FutureTask.java:266)
      3. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      4. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      5. java.lang.Thread.run(Thread.java:745)
      5 frames
    9. JBoss Threads
      JBossThread.run
      1. org.jboss.threads.JBossThread.run(JBossThread.java:320)
      1 frame