1
Spring bean 설정 파일에 문제가있다. Spring Tool Suite 3.4 및 Spring 3.1.1 jar (MVC, jdbc, 보안)를 사용하고 있습니다. 이 단지 IDE에서 경고하지만 응용 프로그램이 응용 프로그램 서버에로드 될 때 다음과 같은 오류Spring 설정 파일 네임 스페이스 해결
Spring Configuration File - login-security.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:security="http://www.springframework.org/schema/security"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd">
<beans:import resource='login-service.xml'/>
<security:http>
<security:intercept-url pattern='/home*' access='ROLE_USER,ROLE_ADMIN' />
<security:intercept-url pattern='/admin*' access='ROLE_ADMIN' />
<security:form-login login-page='/login.jsp' default-target-url='/home' authentication-failure-url='/login.jsp?error=true'/>
<security:logout logout-success-url='/login.jsp' />
<security:anonymous username='guest' granted-authority='ROLE_GUEST'/>
<security:remember-me/>
</security:http>
<security:authentication-manager>
<security:authentication-provider>
<security:jdbc-user-service data-source-ref='myDataSource'
users-by-username-query="select username, password, 'true' as enabled from USER_DETAILS where username=?"
authorities-by-username-query="select USER_DETAILS.username , USER_AUTH.AUTHORITY as authorities from USER_DETAILS,USER_AUTH
where USER_DETAILS.username = ? AND USER_DETAILS.username=USER_AUTH.USERNAME"></security:jdbc-user-service>
</security:authentication-provider>
</security:authentication-manager>
WARNING. ERROR IN CONSOLE - org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/security]
Offending resource: ServletContext resource [/WEB-INF/spring/appServlet/login-security.xml]
제안 후 - 스프링 보안 웹 jar (또는 종속성 중 하나)의 클래스를 사용할 수 없습니다. –
이전에는이 문제를 보지 못했습니다. 빠른 구글 준이 .. http://forum.spring.io/forum/spring-projects/security/102538-configuration-problem-spring-security-web-classes-are-not-available-you-need – dectarin
위에서 작성한 것과 동일한 보안 컨텍스트를 사용하여 샘플 프로젝트를 만들었습니다.이 프로젝트는 저에게 맞습니다. 따라서 pom.xml 파일의 내용을 나에게 제공 할 수 있다면 유용 할 것입니다. – dectarin