• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

servlet mapping issue?

 
Ranch Hand
Posts: 618
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to define all your servlets before doing the servlet-mappings.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How is it complaining? Have you validated your entire web.xml file and confirmed that it is well-formed?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic