2016-05-18 40 views
2

我在第6行獲得一個錯誤「在根元素之後的文檔中的標記必須符合要求,形成「。我試圖找出原因,但不知道。在配置spring security.xml時獲取錯誤文檔中跟在根元素後面的標記必須是格式良好的

<http auto-config="true"> 
    <intercept-url pattern="/xxxx**" access="xxxx" /> 
    <intercept-url pattern="/xxx**" access="xxx,xxx" /> 
</http> 
    <authentication-manager> 
    <authentication-provider> 
    <user-service> 
    <user name="xxx" password="xxx" authorities="xxxxx" /> 
    <user name="xxxx" password="xxxx" authorities="xxxxx" /> 
    <user name="xxxx" password="xxxxx" authorities="xxxx" /> 
    </user-service> 
    </authentication-provider> 
</authentication-manager> 

回答

3

看起來像你的xml代碼不包含任何bean標記。

嘗試豆類標籤之間添加如下代碼

<beans:beans xmlns="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-4.1.xsd 
    http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-4.0.xsd"> 

------ Your Code ------- 

<beans:beans> 
相關問題