Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlet mapping issue?

 
Stephen Huey
Ranch Hand
Posts: 618
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anyone familiar with this stuff that's showing up in my Tomcat stderr logs?
SEVERE: Parse Error at line 914 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-config?,mime-
................
In my web.xml, I have the following in my web-app element:

The one for my Controller servlet was already working (I finally figured that one out), and then I created the LoginLookup one, and it served to work when I access it in my website, but Tomcat seems to be complaining about it for some reason.
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to define all your servlets before doing the servlet-mappings.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13062
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its a good idea to download the servlet specification from here.
To get the exact details on the required order of elements in web.xml.
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, validating the XML document with a validating parser is a good idea so you don't have to wait until you deploy your application before you find out that it's all messed up. (I develop in JBuilder, where it's a simple context menu click or two.) Most, if not all, XML editors allow you to validate the document against some DTD these days.
 
Stephen Huey
Ranch Hand
Posts: 618
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I moved the following up above all the servlet mappings and it's still complaining:

<servlet>
<servlet-name>LoginLookup</servlet-name>
<servlet-class>wwxchange.LoginLookup</servlet-class>
</servlet>

<servlet>
<servlet-name>Controller</servlet-name>
<servlet-class>wwxchange.Controller</servlet-class>
</servlet>
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How is it complaining? Have you validated your entire web.xml file and confirmed that it is well-formed?
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic