I just dealt with this upgrading from JBoss with Tomcat 3 to Tomcat 4. Sax parsing of DTD 2.3 requires that the elements in your web.xml be in the order it's showing you in the error message:
icon?,display-name?,description?,distributable?,context-param*,filter*,filte r-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mapping* ,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,secu rity-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-local- ref* Re-arrange them and it will eliminate this error. This error should be explained a lot more clearly, what it says here too ambiguous. Greg -----Original Message----- From: A mailing list for discussion about Sun Microsystem's Java Servlet API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Edward Sent: Friday, May 31, 2002 3:28 AM To: [EMAIL PROTECTED] Subject: Why my web.xml is error? I have a question about servlet's web.xml file,I put my files into follows directories: D:\Apache Tomcat 4.0\webapps\login\WEB-INF\classes\GetUserIdentity.class D:\Apache Tomcat 4.0\webapps\login\WEB-INF\web.xml D:\Apache Tomcat 4.0\webapps\login\servlets\index.html My web.xml is follows: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd"> <web-app> <session-config> <session-timeout> 30 </session-timeout> </session-config> <welcome-file-list> <welcome-file> index.html </welcome-file> </welcome-file-list> <servlet> <servlet-name> GetUserIdentity </servlet-name> <servlet-class> GetUserIdentity </servlet-class> </servlet> </web-app> //---------Here is 24 line--------- When I start Tomcat4.0,I got error: Starting service Tomcat-Standalone Apache Tomcat/4.0.1 PARSE error at line 24 column 12 org.xml.sax.SAXParseException: The content of element type "web-app" must match "(icon?,display-name?,description?,distributable?,context-param*,filter*,fil ter- mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mapping*,w elco me-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,security-c onst raint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-local-ref*)". Starting service Tomcat-Apache Apache Tomcat/4.0.1 I don't know why my web.xml is error,how to correct it? Thanks! Edward ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
