- This topic has 3 replies, 3 voices, and was last updated 19 years, 11 months ago by
Scott Anderson.
-
AuthorPosts
-
Riyad KallaMemberCopied from PM
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.July 12, 2005 at 8:51 am #232786
Riyad KallaMemberThe reason this is happening is because the web.xml file requires a certain order to it. What you are likely doing is adding your <servlet> entries out of sequence with the other tags. Take a look at that long error message:
(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*)
That is the order the tags must occur in.
July 12, 2005 at 11:47 am #232806
java_user_hereMemberThe problem is beacuse we were migrating our application to tomcat4 from tomcat3. With tomcat4 it is checking for the ordering of elements. We had the same web.xml deployed in tomcat3 for years and it was not having issues. Starting from tomcat4 they have made a check for the ordering of the elements in web.xml.
Regards,
Sundar.July 12, 2005 at 7:56 pm #232835
Scott AndersonParticipantSundar,
Starting from tomcat4 they have made a check for the ordering of the elements in web.xml.
Yes, the ordering is enforced by default in Tomcat 4. Luckily, reordering your descriptor shouldn’t be a big deal.
-
AuthorPosts