web-dev-qa-db-ja.com

Web.xml:要素javaeeで始まる無効なコンテンツが見つかりました

EclipseIDEでこのエラーが発生します。

enter image description here

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://Java.Sun.com/xml/ns/j2ee" xmlns:javaee="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/j2ee http://Java.Sun.com/xml/ns/j2ee/web-app_2_4.xsd" id="WebApp_ID" version="2.4">
  <javaee:display-name>Spring Web MVC Application</javaee:display-name>
  <filter>
    <filter-name>springSecurityFilterChain</filter-name>
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>springSecurityFilterChain</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
  <servlet>
    <servlet-name>mvc-dispatcher</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>mvc-dispatcher</servlet-name>
    <url-pattern>/</url-pattern>
  </servlet-mapping>
  <context-param>
    <javaee:param-name>contextConfigLocation</javaee:param-name>
    <javaee:param-value>/WEB-INF/mvc-dispatcher-servlet.xml /WEB-INF/spring-security.xml</javaee:param-value>
  </context-param>
  <listener>
    <javaee:listener-class>org.springframework.web.context.ContextLoaderListener</javaee:listener-class>
  </listener>

Eclipse問題ログ

Description Resource    Path    Location    Type
cvc-complex-type.2.4.a: Invalid content was found starting with element 'javaee:display-name'. One of '{"http://Java.Sun.com/xml/ns/j2ee":description, "http://Java.Sun.com/xml/ns/j2ee":display-name, "http://Java.Sun.com/xml/ns/j2ee":icon, "http://Java.Sun.com/xml/ns/j2ee":distributable, "http://Java.Sun.com/xml/ns/j2ee":context-param, "http://Java.Sun.com/xml/ns/j2ee":filter, "http://Java.Sun.com/xml/ns/j2ee":filter-mapping, "http://Java.Sun.com/xml/ns/j2ee":listener, "http://Java.Sun.com/xml/ns/j2ee":servlet, "http://Java.Sun.com/xml/ns/j2ee":servlet-mapping, "http://Java.Sun.com/xml/ns/j2ee":session-config, "http://Java.Sun.com/xml/ns/j2ee":mime-mapping, "http://Java.Sun.com/xml/ns/j2ee":welcome-file-list, "http://Java.Sun.com/xml/ns/j2ee":error-page, "http://Java.Sun.com/xml/ns/j2ee":jsp-config, "http://Java.Sun.com/xml/ns/j2ee":security-constraint, "http://Java.Sun.com/xml/ns/j2ee":login-config, "http://Java.Sun.com/xml/ns/j2ee":security-role, "http://Java.Sun.com/xml/ns/j2ee":env-entry, "http://Java.Sun.com/xml/ns/j2ee":ejb-ref, "http://Java.Sun.com/xml/ns/j2ee":ejb-local-ref, "http://Java.Sun.com/xml/ns/j2ee":service-ref, "http://Java.Sun.com/xml/ns/j2ee":resource-ref, "http://Java.Sun.com/xml/ns/j2ee":resource-env-ref, "http://Java.Sun.com/xml/ns/j2ee":message-destination-ref, "http://Java.Sun.com/xml/ns/j2ee":message-destination, "http://Java.Sun.com/xml/ns/j2ee":locale-encoding-mapping-list}' is expected.   web.xml /cms-web/WebContent/WEB-INF line 3  XML Problem


Description Resource    Path    Location    Type
cvc-complex-type.2.4.a: Invalid content was found starting with element 'javaee:listener-class'. One of '{"http://Java.Sun.com/xml/ns/j2ee":description, "http://Java.Sun.com/xml/ns/j2ee":display-name, "http://Java.Sun.com/xml/ns/j2ee":icon, "http://Java.Sun.com/xml/ns/j2ee":listener-class}' is expected.    web.xml /cms-web/WebContent/WEB-INF line 26 XML Problem

Description Resource    Path    Location    Type
cvc-complex-type.2.4.a: Invalid content was found starting with element 'javaee:param-name'. One of '{"http://Java.Sun.com/xml/ns/j2ee":description, "http://Java.Sun.com/xml/ns/j2ee":param-name}' is expected.    web.xml /cms-web/WebContent/WEB-INF line 22 XML Problem
6
AppSensei

XSDに準拠していません。 javaee:を削除する必要があります:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://Java.Sun.com/xml/ns/j2ee" xmlns:javaee="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/j2ee http://Java.Sun.com/xml/ns/j2ee/web-app_2_4.xsd" id="WebApp_ID" version="2.4">
<display-name>Spring Web MVC Application</display-name>
...
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/mvc-dispatcher-servlet.xml /WEB-INF/spring-security.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
12
Michael