This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes servlet deployment error in web.xml on WSAD 4.x Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "servlet deployment error in web.xml on WSAD 4.x" Watch "servlet deployment error in web.xml on WSAD 4.x" New topic
Author

servlet deployment error in web.xml on WSAD 4.x

Ashok Haluvarthi
Greenhorn

Joined: Jul 04, 2002
Posts: 13
Hello,
while deploying the servlet I am getting following error, when I keep more than one servlet entry in my web.xml. I am running this application on WSAD 4.x. Please let me know, if any body came acoss this kind of problem.
org.xml.sax.SAXParseException: The content of element type "web-app" must match "(icon?,display-name?,description?,distributable?,context-param*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*)".
at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1196)
My web.xml contains....
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app id="WebApp">
<display-name>xKanbanWeb</display-name>
<servlet>
<servlet-name>ComponentList</servlet-name>
<display-name>ComponentList</display-name>
<servlet-class>com.emerson.ekanban.servlets.ComponentListServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ComponentList</servlet-name>
<url-pattern>ComponentList</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>Authentication</servlet-name>
<display-name>Authentication</display-name>
<servlet-class>com.emerson.ekanban.servlets.AuthenticationServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Authentication</servlet-name>
<url-pattern>eKanban/Authentication</url-pattern>
</servlet-mapping>

<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>

thanks
Anil
Debashish Chakrabarty
Ranch Hand

Joined: May 14, 2002
Posts: 226

The error says it load and clear. All the mappings must come after all the servlets have been declared. This should work


Debashish
SCJP2, SCWCD 1.4
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: servlet deployment error in web.xml on WSAD 4.x
 
Similar Threads
web.xml
problem in web.xml
Listener started twice
Configure tomcat resource factory
parse error with web-app when starting tomact