You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "J. W. Ballantine" <jw...@homer.att.com> on 2003/07/03 14:21:21 UTC
web.xml help
Hi,
I'm new to this, and quickly going blind looking at a web.xml.
When I start tomcat I get the following error message during start-up:
Starting service Tomcat-Standalone
Apache Tomcat/4.1.24
Jul 3, 2003 8:09:11 AM org.apache.commons.digester.Digester error
SEVERE: Parse Error at line 34 column 11: The content of element type
"web-app" must match "(icon?,display-name?,description?,distributable?,context-
param*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,session-conf
ig?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,reso
urce-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*
,ejb-local-ref*)".
org.xml.sax.SAXParseException: 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-mappin
g*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,secur
ity-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-local-ref*
)".
The file in questions is:
-------------top of file (not in xml)
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name> HelloWorld </servlet-name>
<servlet-class> HelloWorld </servlet-class>
</servlet>
<servlet-mapping>
<servlet-name> HelloWorld </servlet-name>
<url-pattern> /HelloWorld </url-pattern>
</servlet-mapping>
<servlet>
<servlet-name> HelloServlet </servlet-name>
<servlet-class> HelloServlet </servlet-class>
</servlet>
<servlet-mapping>
<servlet-name> HelloServlet </servlet-name>
<url-pattern> /HelloServlet </url-pattern>
</servlet-mapping>
<servlet>
<servlet-name> IntsServlet </servlet-name>
<servlet-class> IntsServlet </servlet-class>
</servlet>
<servlet-mapping>
<servlet-name> IntsServlet </servlet-name>
<url-pattern> /IntsServlet </url-pattern>
</servlet-mapping>
</web-app>
--------------------- end of file (not in xml)
Now the file is 34 lines long and the 11th column is after the p> and is
an end of line (same problem if it's a blank). If I add or delete blank line,
the
line number on the error changes, so I have the problem file.
I've been staring at it for 8 hours and don't see anything wrong, will some
xml expert take a look and see what I'm doing wrong??
Thanks
Jim
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: web.xml help
Posted by John Turner <to...@johnturner.com>.
servlet-mapping tags must follow servlet tags. All of them. Don't do
servlet/servlet-mapping, servlet/servlet-mapping, do ALL servlets then do
ALL servlet-mappings.
John
On Thu, 03 Jul 2003 08:21:21 -0400, J. W. Ballantine <jw...@homer.att.com>
wrote:
>
> Hi,
>
> I'm new to this, and quickly going blind looking at a web.xml.
>
> When I start tomcat I get the following error message during start-up:
>
> Starting service Tomcat-Standalone
> Apache Tomcat/4.1.24
> Jul 3, 2003 8:09:11 AM org.apache.commons.digester.Digester error
> SEVERE: Parse Error at line 34 column 11: The content of element type
> "web-app" must match "(icon?,display-
> name?,description?,distributable?,context-
> param*,filter*,filter-mapping*,listener*,servlet*,servlet-
> mapping*,session-conf
> ig?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-
> ref*,reso
> urce-ref*,security-constraint*,login-config?,security-role*,env-
> entry*,ejb-ref*
> ,ejb-local-ref*)".
> org.xml.sax.SAXParseException: 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-
> mappin
> g*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-
> ref*,secur
> ity-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-
> local-ref*
> )".
>
> The file in questions is:
> -------------top of file (not in xml)
> <?xml version="1.0" encoding="ISO-8859-1"?>
>
> <!DOCTYPE web-app
> PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
> "http://java.sun.com/dtd/web-app_2_3.dtd">
>
> <web-app>
>
> <servlet>
> <servlet-name> HelloWorld </servlet-name>
> <servlet-class> HelloWorld </servlet-class>
> </servlet>
> <servlet-mapping>
> <servlet-name> HelloWorld </servlet-name>
> <url-pattern> /HelloWorld </url-pattern>
> </servlet-mapping>
> <servlet>
> <servlet-name> HelloServlet </servlet-name>
> <servlet-class> HelloServlet </servlet-class>
> </servlet>
> <servlet-mapping>
> <servlet-name> HelloServlet </servlet-name>
> <url-pattern> /HelloServlet </url-pattern>
> </servlet-mapping>
> <servlet>
> <servlet-name> IntsServlet </servlet-name>
> <servlet-class> IntsServlet </servlet-class>
> </servlet>
> <servlet-mapping>
> <servlet-name> IntsServlet </servlet-name>
> <url-pattern> /IntsServlet </url-pattern>
> </servlet-mapping>
>
> </web-app>
> --------------------- end of file (not in xml)
>
> Now the file is 34 lines long and the 11th column is after the p> and is
> an end of line (same problem if it's a blank). If I add or delete blank
> line, the
> line number on the error changes, so I have the problem file.
>
> I've been staring at it for 8 hours and don't see anything wrong, will
> some
> xml expert take a look and see what I'm doing wrong??
>
> Thanks
>
> Jim
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: web.xml help
Posted by Ben Souther <bs...@fwdco.com>.
You have to list all of your servlet elements before listing any of the
servlet-mapping elements.
On Thursday 03 July 2003 08:21 am, J. W. Ballantine wrote:
> Hi,
>
> I'm new to this, and quickly going blind looking at a web.xml.
>
> When I start tomcat I get the following error message during start-up:
>
> Starting service Tomcat-Standalone
> Apache Tomcat/4.1.24
> Jul 3, 2003 8:09:11 AM org.apache.commons.digester.Digester error
> SEVERE: Parse Error at line 34 column 11: The content of element type
> "web-app" must match
> "(icon?,display-name?,description?,distributable?,context-
> param*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,session-
>conf
> ig?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,
>reso
> urce-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-
>ref* ,ejb-local-ref*)".
> org.xml.sax.SAXParseException: 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-ma
>ppin
> g*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,s
>ecur
> ity-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-local-
>ref* )".
>
> The file in questions is:
> -------------top of file (not in xml)
> <?xml version="1.0" encoding="ISO-8859-1"?>
>
> <!DOCTYPE web-app
> PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
> "http://java.sun.com/dtd/web-app_2_3.dtd">
>
> <web-app>
>
> <servlet>
> <servlet-name> HelloWorld </servlet-name>
> <servlet-class> HelloWorld </servlet-class>
> </servlet>
> <servlet-mapping>
> <servlet-name> HelloWorld </servlet-name>
> <url-pattern> /HelloWorld </url-pattern>
> </servlet-mapping>
> <servlet>
> <servlet-name> HelloServlet </servlet-name>
> <servlet-class> HelloServlet </servlet-class>
> </servlet>
> <servlet-mapping>
> <servlet-name> HelloServlet </servlet-name>
> <url-pattern> /HelloServlet </url-pattern>
> </servlet-mapping>
> <servlet>
> <servlet-name> IntsServlet </servlet-name>
> <servlet-class> IntsServlet </servlet-class>
> </servlet>
> <servlet-mapping>
> <servlet-name> IntsServlet </servlet-name>
> <url-pattern> /IntsServlet </url-pattern>
> </servlet-mapping>
>
> </web-app>
> --------------------- end of file (not in xml)
>
> Now the file is 34 lines long and the 11th column is after the p> and is
> an end of line (same problem if it's a blank). If I add or delete blank
> line, the
> line number on the error changes, so I have the problem file.
>
> I've been staring at it for 8 hours and don't see anything wrong, will some
> xml expert take a look and see what I'm doing wrong??
>
> Thanks
>
> Jim
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
--
Ben Souther
F.W. Davison & Company, Inc.
REGISTER NOW FOR THE SCORPEO USER CONFERENCE!
September 18-19, 2003 in Boston/Brookline, MA
Additional Training Sessions held September 17, 2003
More info >> http://www.fwdco.com/services/Uconf03/default.shtm
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org