2723 [Thread-1] DEBUG org.springframework.core.env.StandardEnvironment - Adding [systemEnvironment] PropertySource with lowest search precedence
2723 [Thread-1] DEBUG org.springframework.core.env.StandardEnvironment - Initialized StandardEnvironment with PropertySources [systemProperties,systemEnvironment]
2725 [Thread-1] DEBUG org.springframework.beans.BeanUtils - No property editor [org.springframework.security.web.authentication.logout.LogoutSuccessHandlerEditor] found for type org.springframework.security.web.authentication.logout.LogoutSuccessHandler according to 'Editor' suffix convention
2726 [Thread-1] DEBUG org.springframework.beans.TypeConverterDelegate - **Field [/admin/login] isn't an enum value**
java.lang.NoSuchFieldException: /admin/login
at java.lang.Class.getField(Class.java:1537)
at org.springframework.beans.TypeConverterDelegate.attemptToConvertStringToEnum(TypeConverterDelegate.java:287)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:218)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:92)
at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:451)
我在一个控制器中有/admin/login
作为映射:
@RequestMapping(value="/admin/login", method=RequestMethod.GET)
public ModelAndView getLoginPage(@RequestParam(value="failedAttempt", required=false) boolean failedAttempt, ModelMap model) {
除此之外,spring-security.xml
中提到了这个字符串。
我的服务器启动时会显示此错误。我甚至没有去/admin/login
页面。
我的安全xml。
<security:intercept-url pattern="/admin/login" access="permitAll"/>
<security:intercept-url pattern="/admin/denied" access="permitAll"/>
<security:intercept-url pattern="/admin/logout" access="permitAll"/>
<security:intercept-url pattern="/admin/*" access="hasRole('AUTHOR')"/>
<security:intercept-url pattern="/admin**" access="hasRole('AUTHOR')"/>
<security:form-login
login-page="/admin/login"
login-processing-url="/admin/j_spring_security_check"
authentication-failure-url="/admin/login?failedAttempt=true"
default-target-url="/admin/home"/>
<security:logout
invalidate-session="true"
logout-success-url="/admin/login"
logout-url="/admin/logout"/>
</security:http>
答案 0 :(得分:5)
没有错误。只有调试级别的堆栈跟踪,其中Spring正在尝试为登录成功处理程序找到正确的构造函数(默认情况下有2个构造函数,只有一个将匹配作为参数提供的String,即&#34; / admin / login&#34 )。您可以忽略它,也可以将其关闭(在该级别进行调试日志记录通常不是非常有用,您可能不希望在生产中使用它。)