【发布时间】:2011-04-13 13:02:04
【问题描述】:
applicationContext.xml:
<bean id="defaultEntryPoint" class="com.spsetia.companyapp.company.services.CustomAuthenticationEntryPoint">
<property name="securityConfiguration" ref="securityConfiguration" />
<!-- Default filter chain proxy -->
<property name="proxy" ref="_filterChainProxy" />
</bean>
web.xml:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml
</param-value>
</context-param>
<filter>
<filter-name>redirect</filter-name>
<filter-class>org.apache.tapestry.RedirectFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>redirect</filter-name>
<url-pattern>/</url-pattern>
</filter-mapping>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<filter>
<filter-name>_filterChainProxy</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>_filterChainProxy</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.springframework.security.ui.session.HttpSessionEventPublisher</listener-class>
</listener>
<servlet>
<servlet-name>app</servlet-name>
<servlet-class>
org.apache.tapestry.ApplicationServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
但我收到此错误:
org.springframework.beans.factory.BeanCreationException: 创建具有名称的 bean 时出错 “_filterChainList”:无法解析 参考豆 '_exceptionTranslationFilter' 同时 使用设置 bean 属性“过滤器” 键[2];嵌套异常是 org.springframework.beans.factory.BeanCreationException: 创建具有名称的 bean 时出错 '_exceptionTranslationFilter': bean初始化失败;嵌套的 例外是 org.springframework.beans.factory.BeanCreationException: 创建具有名称的 bean 时出错 'defaultEntryPoint' 定义在 ServletContext 资源 [/WEB-INF/applicationContext.xml]: 无法解析对 bean 的引用 设置bean时的'_filterChainProxy' 属性“代理”;嵌套异常是 org.springframework.beans.factory.BeanCreationException: 创建具有名称的 bean 时出错 '_filterChainProxy':初始化 豆失败;嵌套异常是 java.lang.NullPointerException
我做错了什么?
【问题讨论】:
-
@Bozho,我查看了堆栈跟踪,但我没有看到任何重要信息。我可以知道我是否需要在 applicationContext.xml 中定义 id=_filterChainProxy 的 bean?因为我只在 web.xml 中定义了它。
标签: java spring spring-security