2017-01-01 2 views
0

을 나는이 예외 : org.springframework.beans.factory.parsing.BeanDefinitionParsingException : 구성 문제 : XML 스키마 네임 스페이스 [http://www.springframework.org/schema/security] 문제가되는 자원에 대한 봄 NamespaceHandler가를 찾을 수 없습니다 : ServletContext를 resource [/WEB-INF/spring/security.xml]봄 보안 - 봄 NamespaceHandler가 찾을 수 없습니다 - 보안

Google에서 몇 분, 나에게 말해줘, 나는 dependence - spring-security-config를 추가해야한다. 나는이 최신 버전 4.2.1 있지만 예외가 있습니다.

security.xml

<?xml version="1.0" encoding="UTF-8"?> 
<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"> 

<beans:bean name="standartEncrypt" 
      class="org.springframework.security.crypto.password.StandardPasswordEncoder" > 
    <beans:constructor-arg name="secret" value="3u6gui" /> 
</beans:bean> 

<http auto-config="true" > 
    <intercept-url pattern="/notes/**" access="authenticated" /> 
    <intercept-url pattern="/register" requires-channel="https" /> 
    <intercept-url pattern="/" access="permitAll" /> 
    <intercept-url pattern="/accessDenied" access="permitAll" /> 
    <intercept-url pattern="/duplicate" access="permitAll" /> 
    <intercept-url pattern="/notExists" access="permitAll" /> 

    <access-denied-handler error-page="/accessDenied" /> 

    <logout 
      logout-success-url="/index" 
      logout-url="/notes/{username}/exit" 
    /> 
    <form-login 
      authentication-failure-url="/accessDenied" 
      login-page="/register" 
      login-processing-url="/register" 
      password-parameter="password" 
      username-parameter="username" 
    /> 
    <remember-me data-source-ref="dataSource" /> 

    <session-management session-fixation-protection="newSession"> 
     <concurrency-control max-sessions="1" error-if-maximum-exceeded="true" /> 
    </session-management> 
</http> 

<authentication-manager > 
    <authentication-provider> 
     <password-encoder ref="standartEncrypt" /> 
     <jdbc-user-service data-source-ref="dataSource" users-by-username-query="SELECT username, password FROM Users WHERE username = ?"/> 
    </authentication-provider> 
</authentication-manager> 

<global-method-security jsr250-annotations="enabled" secured-annotations="enabled" /> 

받는다는

<dependency> 
    <groupId>org.springframework.security</groupId> 
    <artifactId>spring-security-config</artifactId> 
    <version>4.2.1.RELEASE</version> 
</dependency> 

답변

0

가능성이 미해결 종속성이다. 당신의 메이븐 POM 또는 프로젝트 구성을 보지 않고, 봄 보안을위한 최소한이다 : 당신이 봄 도구 스위트 또는 Eclipse를 사용하는 경우

<dependency> 
    <groupId>org.springframework.security</groupId> 
    <artifactId>spring-security-web</artifactId> 
    <version>4.2.1.RELEASE</version> 
</dependency> 
<dependency> 
    <groupId>org.springframework.security</groupId> 
    <artifactId>spring-security-config</artifactId> 
    <version>4.2.1.RELEASE</version> 
</dependency> 

하면, 다음, 프로젝트를 오른쪽 클릭 Maven -> Update Project을 선택하고 전체 clean install을해야합니다