File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes web.xml issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "web.xml issue" Watch "web.xml issue" New topic

web.xml issue

Jason Kretzer
Ranch Hand

Joined: May 31, 2001
Posts: 280
Hello all,
I am having problems with my web.xml file. When I start Tomcat 4.0.4, I get the following on my DOS window:

Also, here is my web.xml file. Note:When I delete the portion dedicated to the TopLineGenerator, the HelloWorld servlet comes up fine. But neither comes up when I add it in and I get the message above.

Any ideas?
[ June 26, 2002: Message edited by: Jason Kretzer ]

Jason R. Kretzer<br />Software Engineer<br />System Administrator<br /><a href="" target="_blank" rel="nofollow"></a>
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

XML DTD's give you the required structure of XML files. You are throwing a parse exception, so something is wrong with your structure.

As a guide...
(icon?, display-name? ... context-param*, filter* ... servlet*, servlet-mapping* ...)

( - start the element
? - optional
* - can be 0 to many
, - list seperator -> order IS implied.
(and ... is my way of snipping out things)

So the above example could be read out: A web-app element is composed of optionally an icon followed by optionally a display-name followed by zero or more context-params followed by zero or more filters followed by zero or more servlets followed by zero or more servlet-mappings

the "order IS implied" is the big clue.
[ June 26, 2002: Message edited by: Mike Curwen ]
Anthony Villanueva
Ranch Hand

Joined: Mar 22, 2002
Posts: 1055
Just list ALL your <servlet> elements first, followed by the <servlet-mapping> elements.
I agree. Here's the link:
subject: web.xml issue
It's not a secret anymore!