1

基本上我得到一个基于此的错误:

Caused by: java.lang.IllegalStateException: Cannot convert value of type [example.TestAuthFilterEntryPoint] to required type [org.springframework.security.web.AuthenticationEntryPoint] for property 'authenticationEntryPoint': no matching editors or conversion strategy found
... 42 more

基本上我只将这个类实现为 AuthenticationEntryPoint

import org.springframework.security.ui.AuthenticationEntryPoint;
import org.springframework.security.AuthenticationException;
public class TestAuthFilterEntryPoint implements AuthenticationEntryPoint,
    InitializingBean {...

在如何正确“转换”它方面,我是否遗漏了一些东西?

4

1 回答 1

1

你应该实现的接口org.springframework.security.web在 Spring Security >= 3.0 的包中(就像你在错误消息中一样),所以它应该是:

import org.springframework.security.web.AuthenticationEntryPoint;
import org.springframework.security.AuthenticationException;
public class TestAuthFilterEntryPoint implements AuthenticationEntryPoint,
    InitializingBean {
  // ...
于 2012-10-05T12:37:17.610 回答