2010-11-30 5 views
1

부두에서 실행할 때 스프링 구성에 문제가 있습니다. 바람둥이에 똑같은 파일을 아무런 문제없이 사용했습니다. 내가 얻는 오류는 다음과 같습니다.부두에서 XML 스키마 오류

org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 6 in XML document from ServletContext resource [/WEB-INF/web-application-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException: s4s-elt-character: Non-whitespace characters are not allowed in schema elements other than 'xs:appinfo' and 'xs:documentation'. Saw 'SpringSource.org | '. 
Caused by: org.xml.sax.SAXParseException: s4s-elt-character: Non-whitespace characters are not allowed in schema elements other than 'xs:appinfo' and 'xs:documentation'. Saw 'SpringSource.org | '. 

내 스키마는 다음과 같습니다.

<?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-3.0.xsd 
http://www.springframework.org/schema/security 
http://www.springframework.org/schema/security/spring-security-3.0.5.xsd"> 

나는 무엇이 잘못 될 수 있는지 전혀 모른다. 두 가지 구성으로 테스트를 해본 결과이 오류가 발생했습니다.

+0

검사가 나와 (당신이 받는다는을 사용하는 경우 당신은 당신의 클래스 경로에 봄 보안 구성 항아리 누락 짧은 요점을 되풀이은 아래의 종속성을 추가)이 http://www.springframework.org/schema/security/ –

답변

0

분명히 XML 속성 내에 줄 바꿈 문자를 사용할 수 없습니다.

xsi:schemaLocation 속성 값을 모두 한 줄에 넣습니다.

+0

나는 이미 그것을 시도했다는 것을 맹세하겠다. –

+0

나는이 대답이 잘못되었다고 생각한다. http://stackoverflow.com/a/449647/90033 – Konstantin

+0

@Konstantin : 이것은 XML 표준의 문제는 아니지만,이 특정 파서가 외부 로딩을로드 할 수 없을 때 발생하는 문제 개요. –

2

다음 URL은 잘못된 것, 그리고 당신이 하나를 시도 할 수

http://www.springframework.org/schema/security/spring-security-3.0.5.xsd 

을 springsource.org 리디렉션?

http://www.springframework.org/schema/security/spring-security-3.0.4.xsd 
+0

Ah tnx. 그런 간단한 해결책. 이전에 그런 오류가 발생했기 때문에 유효하지 않은 스키마 위치에 대한 다른 오류가 예상됩니다. 여전히 동일한 오류가 발생했지만 이제는 더 자세히 설명됩니다. –