spring-security中的 No AuthenticationEntryPoint could be established异常处理.

异常:

严重: Context initialization failed
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: No AuthenticationEntryPoint could be established. Please make sure you have a login mechanism configured through the namespace (such as form-login) or specify a custom AuthenticationEntryPoint with the 'entry-point-ref' attribute 
Offending resource: class path resource [spring-security.xml]

文本翻译:

配置问题:无法建立AuthenticationEntryPoint。请确保通过命名空间配置了登录机制(例如表单登录),或使用“entry point ref”属性指定自定义AuthenticationEntryPoint

违规资源:类路径资源[spring security.xml]

处理方法:

由于疏忽在spring-security.xml文件中忘了加

 <form-login/> <!-- 页面拦截,开启表单登录功能—->

加上就好了

    <http use-expressions="false">
        <intercept-url pattern="/**" access="ROLE_USER" />
         <!-- 页面拦截,开启表单登录功能 -->
        <form-login /> 
    </http>

 



posted @ 2020-05-04 11:36  三七_37  阅读(763)  评论(0编辑  收藏  举报