【问题标题】:Filter [springSecurityFilterChain]: could not be initialized过滤器 [springSecurityFilterChain]:无法初始化
【发布时间】:2015-02-05 07:25:28
【问题描述】:

第一次,我的程序看起来很棒,一切都在网络上运行,网络服务器启动并运行。 但是在我第二次编辑现有代码后,我在运行时遇到了这个错误(即使只是编辑字符串的值也会给我这个错误):

[ERROR   ] SRVE0321E: The [springSecurityFilterChain] filter did not load during start up.
Filter [springSecurityFilterChain]: could not be initialized
[ERROR   ] SRVE0315E: An execption occurred: com.ibm.ws.webcontainer.webapp.WebAppErrorReport: javax.servlet.ServletException: Filter [springSecurityFilterChain]: could not be initialized
    at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.init(FilterInstanceWrapper.java:158)
    at [internal classes]
Caused by: javax.servlet.ServletException: Filter [springSecurityFilterChain]: could not be initialized
    ... 3 more
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'springSecurityFilterChain' is defined
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:641)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1157)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:280)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)
    at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:979)
    at org.springframework.web.filter.DelegatingFilterProxy.initDelegate(DelegatingFilterProxy.java:324)
    at org.springframework.web.filter.DelegatingFilterProxy.initFilterBean(DelegatingFilterProxy.java:235)
    at org.springframework.web.filter.GenericFilterBean.init(GenericFilterBean.java:199)
    at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.init(FilterInstanceWrapper.java:144)
    ... 1 more

但是在我清理了 web 服务器和项目之后,maven 更新了。这个错误似乎消失了。关于为什么会发生这种情况的任何线索?

在我的 applicationContext 配置文件和 web.xml 中,我为 spring 安全过滤器声明了一个 bean,所以那里的一切都应该正常工作。

【问题讨论】:

  • 你能添加你的applicationContext配置吗?你包括弹簧安全吗?

标签: spring spring-security websphere-liberty


【解决方案1】:

我终于解决了我自己的问题!这种错误很棘手。

由于我使用的是 eclipse,所以对我来说就是这种情况。 每次我在编辑一段代码时让我的服务器运行。然后当我点击保存按钮时,我的服务器会在后台自动重新运行,但是我没有注意这一点,因为我不熟练地点击了保存按钮并再次运行服务器。 (同时,服务器和文档正在尝试在后台渲染)

也许我的电脑速度不够快或其他原因,它只是不断给我错误消息。

我所做的是以下步骤。 清理服务器 -> Maven 构建 -> 更新项目 -> Maven 构建 -> 重新运行服务器 -> (是的!它又可以工作了)

忠告:在编辑代码之前停止服务器!哈哈

【讨论】:

    【解决方案2】:

    我已经尝试过上述解决方案,但似乎我仍然有问题。

    我已经通过以下步骤解决了这个问题。

    转到您的项目 -> 右键单击​​项目 -> 转到 Maven -> 禁用工作区解析

    重建应用程序。它解决了你的问题。

    【讨论】:

      猜你喜欢
      • 2018-08-31
      • 2016-06-14
      • 2011-12-17
      • 1970-01-01
      • 1970-01-01
      • 2013-10-03
      • 1970-01-01
      • 2017-08-19
      • 2011-12-07
      相关资源
      最近更新 更多