2011-07-14 44 views
0

我是新的春天,我試圖創建一個使用Spring Blazeds集成(Flex + Blazeds + Spring + Java)的應用程序,當我運行該應用程序時出現此錯誤:春天「別名是必需的」

02:51:21,852 INFO [XmlBeanDefinitionReader] Loading XML bean definitions from ServletContext resource [/WEB-INF/spring/security-config.xml] 
02:51:23,937 ERROR [ContextLoader] Context initialization failed 
    org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: alias is required. 
    Offending resource: ServletContext resource [/WEB-INF/spring/security-config.xml] 

安全-config.xml文件:

<?xml version="1.0" encoding="UTF-8"?> 
<beans:beans xmlns:security="http://www.springframework.org/schema/security" 
    xmlns:beans="http://www.springframework.org/schema/beans" 
    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.0.xsd 
         http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd"> 

    <security:http> 
     <security:anonymous enabled="false" /> 
     <security:form-login default-target-url="/myContext/Index.html" 
      login-page="/myContext/Login.html" /> 
     <security:remember-me key="myAppKey" services-ref="rememberMeServices" /> 
    </security:http> 

    <beans:bean id="rememberMeServices" 
     class="org.springframework.security.web.authentication.rememberme.TokenBasedRememberMeServices"> 
     <beans:property name="key" value="myAppKey" /> 
     <beans:property name="alwaysRemember" value="true" /> 
    </beans:bean> 

    <security:authentication-manager> 
     <security:authentication-provider> 
      <security:user-service> 
       <security:user name="john" password="john" authorities="ROLE_USER" /> 
       <security:user name="admin" password="admin" authorities="ROLE_USER, ROLE_ADMIN" /> 
       <security:user name="guest" password="guest" authorities="ROLE_GUEST" /> 
      </security:user-service> 
     </security:authentication-provider> 
    </security:authentication-manager> 

</beans:beans> 

我使用彈簧柔性1.5.0彈簧安全2.0.6春季3.0

任何想法是什麼問題?

由於提前, 安德烈

+1

向我們展示完整的堆棧軌跡,而不僅僅是第一對幾行。 – skaffman

回答

0

正如reference manual上市,春天的Flex 1.5.0不會使用Spring Security 2.工作,必須使用Spring Security 3.

除此之外,jbbarquero是正確的,假定這其實是你的問題。

+0

嘿,謝謝你的回答。我使用Spring-Security 3.0.0下載和配置了該應用程序,併發生與3.0.5版本發生的錯誤:java.lang.ClassNotFoundException:org.springframework.security.Authentication。我搜索了這個問題,這是因爲在Spring Security 3.0.x中,他們改變了這個類的包(現在是org.springframework.security.core.Authentication)。任何想法我怎麼能這樣呢? –

+0

嗨,我發現有關ClassNotFoundException的問題。除了spring-flex-core-1.5.0.RELEASE以外,還有一個額外的lib(** org.springframework.flex-1.5.0.CI-367 **)。刪除後,它工作正常! –

+0

太棒了!是的,注意不要混合使用同一個Spring項目的版本。我們都可以感謝Jeremy終於發佈了Spring Flex 1.5 :) –

1

我不是很肯定,但嘗試把一個別名安全:認證經理

<security:authentication-manager alias="authenticationManager"> 

爲什麼不你使用Spring安全3?