What does this web.xml error mean?

后端 未结 5 690
甜味超标
甜味超标 2021-02-02 11:26




        
相关标签:
5条回答
  • 2021-02-02 11:44

    On the surface it appears that the schemaLocation is wrong. Resolving it appears to redirect to a HTML page rather than a XSD schema.

    I would suggest simply removing this line unless you really want to do XSD validation at runtime. Bear in mind the relevant parts will be validated by your servlet container.

    0 讨论(0)
  • 2021-02-02 11:49

    If you replace j2ee by javaee, it will work fine.

    EDIT :

    <web-app version="2.5" 
        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_2_5.xsd">
    

    Edit:

    To know anything further related to this error. Please follow the Link. Here you will find schemas for Java EE deployment descriptors (web.xml).

    0 讨论(0)
  • 2021-02-02 11:53

    I suggest you add ; between 2 passages: xsi:schemaLocation="http://java.sun.com/xml/ns/javaee and http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

    Like this:

    :xsi:schemaLocation="http://java.sun.com/xml/ns/javaee;http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    
    0 讨论(0)
  • 2021-02-02 11:58

    In my case, I had replaced

    xsi:schemaLocation="http://java.sun.com/../.."

    with

    xsi:schemaLocation="http://xmlns.jcp.org/../.."

    Cheers!

    0 讨论(0)
  • 2021-02-02 11:59

    replace

    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd">
    

    with

    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee;http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd">
    

    The solution is that you have to put semicolon between URLs

    I am sure you will not get the error again :)

    0 讨论(0)
提交回复
热议问题