2012-10-05 54 views
1

基本上即時得到基於這樣的錯誤:春季安全的AuthenticationEntryPoint中的applicationContext

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 {... 

我在方面失去了一些東西如何「轉換」這個正確嗎?

回答

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 { 
    // ... 
+0

非常感謝!你甚至可以知道這因爲它非常相似。 無法將[org.springframework.security.authentication.ProviderManager]類型的值轉換爲屬性'authenticationManager'所需的類型[org.springframework.security.AuthenticationManager]:未找到匹配的編輯器或轉換策略 –

+0

只需要google for'AuthenticationManager',第一個鏈接是_AuthenticationManager(Spring Security 3.0.7.RELEASE API)_並且指向包含類包的JavaDoc。這個在'org.springframework.security.authentication'中。 – Xaerxess