facebook

Having more than one in web.xml throws error

  1. MyEclipse IDE
  2.  > 
  3. Installation, Configuration & Updates
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #232764 Reply

    Hi,
    Im using Eclipse IDE and have MyEclipse plugin. I have created a J2EE project and when I have more than one entry for servlet in web.xml im getting this following error.
    The content of element type “web-app” must match (icon?,display-name?,description?,distributable?,context-param*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-local-ref*)
    If I remove all the servlet entry but one this error is not shown 🙁 . Any suggesstions why this is happening.

    Regards,
    Sun.[/list]

    #232803 Reply

    Scott Anderson
    Participant

    Yes, you’re not conforming to the DTD (http://java.sun.com/dtd/web-app_2_3.dtd). Please give it a look and check out the required elements and
    the order mandated in the file.

    #233558 Reply

    Hi,
    This issue is resovled. Previously I was using Tomcat 3 and my web.xml with servlet looks like this <servlet></servlet>
    <servlet-mapping></servlet-mapping>
    <servlet></servlet>
    <servlet-mapping></servlet-mapping>
    which was not throwing the error since it was not validating the xml. But with Tomcat4 the web.xml is validated against the DTD which throws the above error. To resolve the problem I have moved all the servlet tags following by servlet-mapping tags as below
    <servlet></servlet>
    <servlet></servlet>
    <servlet-mapping></servlet-mapping>
    <servlet-mapping></servlet-mapping>

    Regards,
    Sun.

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Having more than one in web.xml throws error

You must be logged in to post in the forum log in