tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nikola Milutinovic <Nikola.Milutino...@ev.co.yu>
Subject Re: ? <servlet> tag
Date Sun, 25 Jul 2004 13:58:23 GMT
Nolan Toone wrote:

>I'm relitivly new to servlets but ....
>
>My environment:
>   jakarta-tomcat-4.1.30
>   Red Hat 9 - 2.4.20-31.9
>   Server version: Apache/2.0.40
>   Server built:   Apr 21 2004 11:49:03
>   MySQL 3.23.58
>
>The Error
>Jul 25, 2004 7:05:24 AM org.apache.commons.digester.Digester error
>SEVERE: Parse Error at line 18 column -1: Element "web-app" does not allow "servlet" here.
>org.xml.sax.SAXParseException: Element "web-app" does not allow "servlet" here.
>
>This is repeated for lines 27,36 & 45 each of which is <servlet> tag.
>All the servlets seem to work just fine except every evening my system
>falls over and I have to restart tomcat (and at the same time I restart Apache).
>
>I've looked at the dtd and it looks like the xml should be good. I've
>run the web.xml file through od to see if I got some strange characters in it but couldn't
find anything.
>
>Here is my web.xml file.
>
>What am I doing wrong? Any suggestions?
>
><?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>BasinCalendar</servlet-name>
>                <servlet-class>BasinCalendar</servlet-class>
>        </servlet>
>        <servlet-mapping>
>                <servlet-name>BasinCalendar</servlet-name>
>                <url-pattern>/servlet/BasinCalendar</url-pattern>
>        </servlet-mapping>
> 
>        <servlet>
>                <servlet-name>EditCalendar</servlet-name>
>                <servlet-class>EditCalendar</servlet-class>
>        </servlet>
>        <servlet-mapping>
>                <servlet-name>EditCalendar</servlet-name>
>                <url-pattern>/servlet/EditCalendar</url-pattern>
>        </servlet-mapping>
> 
>        <servlet>
>                <servlet-name>EditAccount</servlet-name>
>                <servlet-class>EditAccount</servlet-class>
>        </servlet>
>        <servlet-mapping>
>                <servlet-name>EditAccount</servlet-name>
>                <url-pattern>/servlet/EditAccount</url-pattern>
>        </servlet-mapping>
> 
>        <servlet>
>                <servlet-name>Counter</servlet-name>
>                <servlet-class>Counter</servlet-class>
>        </servlet>
>        <servlet-mapping>
>                <servlet-name>Counter</servlet-name>
>                <url-pattern>/servlet/Counter</url-pattern>
>        </servlet-mapping>
> 
>        <servlet>
>                <servlet-name>HelloWorld</servlet-name>
>                <servlet-class>HelloWorld</servlet-class>
>        </servlet>
>        <servlet-mapping>
>                <servlet-name>HelloWorld</servlet-name>
>                <url-pattern>/servlet/HelloWorld</url-pattern>
>        </servlet-mapping>
> 
></web-app>
>  
>

You have to group <servlet> tags together. Cannot mix them with 
<servlet-mapping>. Sounds stupid, but that is the DTD.

Nix.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message