u013254183
老铁咖啡
采纳率94.1%
2015-05-18 05:53

spring security报错,实在是找不出原因

已采纳

说明一下,给别人的项目部署的时候报错的,项目代码没问题,配置也不会错,找了很久的原因不知道错在哪。

图片说明

#这是spring security的配置

 <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:security="http://www.springframework.org/schema/security"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
                        http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
                        http://www.springframework.org/schema/security
                        http://www.springframework.org/schema/security/spring-security-3.1.xsd">


    <security:http auto-config='true'>

    <curity:http>
    <security:http auto-config="true" use-expressions="false" 
        access-denied-page="/login.jsp">

        <security:form-login login-page="/login.jsp"
            authentication-failure-url="/login.jsp?error=true"
            authentication-success-handler-ref="loginSuccessHandler"
            always-use-default-target="true" />
        <security:logout logout-url="/logout" logout-success-url="/login.jsp"/>
        <security:session-management>
            <security:concurrency-control
                max-sessions="1" error-if-maximum-exceeded="false" expired-url="/login.jsp?error=islogin"><curity:concurrency-control>
        <curity:session-management>

        <security:intercept-url pattern="rvices/**"
            access="IS_AUTHENTICATED_FULLY"><curity:intercept-url>
        <security:intercept-url pattern="/jsp/*.jsp"
            access="IS_AUTHENTICATED_FULLY"><curity:intercept-url>
        <security:custom-filter ref="myFilter"
            before="FILTER_SECURITY_INTERCEPTOR" />

    <curity:http>

    <security:authentication-manager alias="authenticationManager">
        <security:authentication-provider
            user-service-ref="myUserDetailService">
        <curity:authentication-provider>
    <curity:authentication-manager>

    <bean id="loginSuccessHandler" class="com.springsecurity.handler.LoginSuccessHandler">
        <property name="jdbcService" ref="jdbcService" />
    </bean>

    <bean id="myFilter" class="com.springsecurity.filter.MyFilterSecurityInterceptor">
        <property name="authenticationManager" ref="authenticationManager" />
        <property name="accessDecisionManager" ref="myAccessDecisionManagerBean" />
        <property name="securityMetadataSource" ref="mySecurityMetadataSource" />
    </bean>
    <bean id="myUserDetailService" class="com.springsecurity.handler.MyUserDetailService">
        <property name="userDao" ref="userDao" />
        <property name="jdbcService" ref="jdbcService" />
    </bean>

    <bean id="myAccessDecisionManagerBean" class="com.springsecurity.filter.MyAccessDecisionManager">
        <property name="myInvocationSecurityMetadataSource" ref="mySecurityMetadataSource" />
    </bean>

    <bean id="mySecurityMetadataSource"
        class="com.springsecurity.filter.MyInvocationSecurityMetadataSource">
        <constructor-arg>
            <ref bean="roleDao" />
        </constructor-arg>
    </bean>
</beans>

这是web.xml的配置

 <filter>
    <filter-name>springSecurityFilterChain</filter-name>
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>springSecurityFilterChain</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

怀疑是架包冲突

图片说明

工程目录

图片说明

还老报这个错

图片说明

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

2条回答

  • guwei4037 极简吧 6年前

    spring security ,里面没有配置。

    点赞 评论 复制链接分享
  • guwei4037 极简吧 6年前

    根据错误提示来看,你没有定义springSecurityFilterchain这个javabean。

    点赞 评论 复制链接分享

相关推荐