Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

More than one servlet entry in web.xml throws error

 
E.Sundar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Im using Eclipse IDE and have MyEclipse plugin. I have created a J2EE project and when I have more than one entry for servlet in web.xml im getting this following error.
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-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,security-constraint*, login-config?,security-role*,env-entry*,ejb-ref*,ejb-local-ref*)
If I remove all the servlet entry but one this error is not shown. Any suggesstions why this is happening.

Regards,
Sun.

[EDIT - broke up long lines]
[ July 17, 2005: Message edited by: David O'Meara ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65535
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Sun",

There aren't may rules that have been put into place here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
Forum Bartender
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any suggesstions why this is happening.

Yes, your web.xml is not in the right form - specifically there is an element at the first level under web-app that is not one of the allowed elements. Without seeing the offending XML thats all that can be said.
Bill
 
Stefan Evans
Bartender
Posts: 1822
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most probably you have put the servlet and servlet-mapping entries together.
ie
<servlet>
<servlet-mapping>
<servlet>
<servlet-mapping>

This creates an error.
Order is important.
You must declare all your servlet tags, and THEN all your servlet mappings.
ie
<servlet>
<servlet>
<servlet-mapping>
<servlet-mapping>

In the servlet2.4 spec this restriction has been removed, and you can put things in any order.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!