2014-07-04 4 views
2

Spring 3, Apache-maven-3.2.2, Apache-tomcat-7.0.54를 사용하고 있습니다.web.xml의 속성이 작동하지 않습니다. 케플러

<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
id="WebApp_ID" version="2.5"> 

그것은 시간 오류를 컴파일주고있다

Multiple annotations found at this line: 
    - cvc-elt.1: Cannot find the declaration of element 'web-app'. 
    - schema_reference.4: Failed to read schema document 'http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd', because 1) 
    could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>. 

답변

1

web.xml에 맨 처음 행은 다음과 같습니다의 대신 <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> : <?xml version="1.0" encoding="ISO-8859-1"?>

은 또한 다음과 같은 태그를 사용할 수 있습니다 가능한 한 시도하는 것. 여기서 사용 된 버전은 시도하는 2.5 대신 3.0입니다.

Java EE 6 호환 서버를 사용하는 경우 버전 3.0을 사용해야합니다.

+1

이와 같이 버전을 변경하면 안됩니다. 버전 3.0은 Java EE 6 호환 응용 프로그램 서버에만 사용해야합니다. – JamesB

+0

그렇기 때문에 내가 가능한 한 말했지 :) – Yasin

+1

나는 두 사람의 차이점을 설명해야한다고 생각한다. – JamesB

관련 문제