2016-08-09 23 views
1

security-context.xmlにセキュリティ上の理由からhttpタグを追加します。Spring Security 3.0

私はセキュリティの名前空間を追加しました。

<beans:beans xmlns="http://www.springframework.org/schema/security" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:batch="http://www.springframework.org/schema/batch" 
xmlns:beans="http://www.springframework.org/schema/beans" 
xmlns:context="http://www.springframework.org/schema/context" 
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
    http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd 
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd 
    http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch.xsd 
    http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd 
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> 

Beanの名前空間を追加しても、この例外がなぜ発生しているのかわかりません。

私は3.0.5スプリングバージョンを持っています。

私はこの中に何か不足していることをお勧めします。 ? スタックトレース:春は自動的にワークスペース内の最上位バージョンを目指すよう

SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener 
    org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath*:spring-security/*-context.xml] 
    Offending resource: class path resource [spring-security/context.xml]; nested exception is org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 31 in XML document from file [security.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'bean'. 

    Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'bean'. 

答えて

0

は、スキーマの場所から-3.0を削除 -

<beans:beans xmlns="http://www.springframework.org/schema/security" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:batch="http://www.springframework.org/schema/batch" 
xmlns:beans="http://www.springframework.org/schema/beans" 
xmlns:context="http://www.springframework.org/schema/context" 
xsi:schemaLocation="http://www.springframework.org/schema/beans   http://www.springframework.org/schema/beans/spring-beans.xsd 
    http://www.springframework.org/schema/util  http://www.springframework.org/schema/util/spring-util.xsd 
    http://www.springframework.org/schema/tx   http://www.springframework.org/schema/tx/spring-tx.xsd 
    http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch.xsd 
    http://www.springframework.org/schema/security  http://www.springframework.org/schema/security/spring-security.xsd 
    http://www.springframework.org/schema/context  http://www.springframework.org/schema/context/spring-context.xsd"> 
+1

を私はセキュリティ3.2を提供し、私のために働いたが、方法がわかりません。私はPOM.xmlに3.0.5 Springバージョンを持っています – ashishl