1 Reply Latest reply on Apr 1, 2003 12:00 PM by Vinay Salehithal

    web.xml problem: Element "web-app" does not allow "servlet".

    carr_ar Newbie

      Okay, I'm probably blind as a bat and missing something very simple here, but I'm running into a what appears to be a weird WEB.XML parsing problem. It seems to be telling me that the <web-app> tag cannot have tags, etc. Can anyone tell me what, if anything, I'm doing wrong here?

      Anytime I put a (or <servlet-mapping>) entry in my web.xml file, the WAR file fails to deploy with the following errors:

      INFO | jvm 1 | 2003/04/01 11:08:40 | 11:08:40,695 INFO [jbossweb] Extract jar:file:/C:/apps/jboss-3.0.4/server/default/tmp/deploy/server/default/deploy/cedar.war/59.cedar.war!/ to C:\WINNT\TEMP\Jetty_0_0_0_0_8080__cedar\webapp
      INFO | jvm 1 | 2003/04/01 11:08:48 | 11:08:48,096 WARN [jbossweb] WARNING: ERROR@file:/C:/WINNT/Temp/Jetty_0_0_0_0_8080__cedar/webapp/WEB-INF/web.xml line:9 col:-1 : org.xml.sax.SAXParseException: Element "web-app" does not allow "servlet" here.
      INFO | jvm 1 | 2003/04/01 11:08:48 | 11:08:48,096 WARN [jbossweb] WARNING: ERROR@file:/C:/WINNT/Temp/Jetty_0_0_0_0_8080__cedar/webapp/WEB-INF/web.xml line:12 col:-1 : org.xml.sax.SAXParseException: Element "servlet" does not allow "description" here.
      INFO | jvm 1 | 2003/04/01 11:08:48 | 11:08:48,106 WARN [jbossweb] WARNING: ERROR@file:/C:/WINNT/Temp/Jetty_0_0_0_0_8080__cedar/webapp/WEB-INF/web.xml line:15 col:-1 : org.xml.sax.SAXParseException: Element "web-app" does not allow "servlet-mapping" here.
      INFO | jvm 1 | 2003/04/01 11:08:48 | 11:08:48,116 INFO [jbossweb] Stopped WebApplicationContext[/cedar,jar:file:/C:/apps/jboss-3.0.4/server/default/tmp/deploy/server/default/deploy/cedar.war/59.cedar.war!/]

      My WEB.XML file follows:

      <?xml version="1.0" encoding="ISO-8859-1" ?>
      <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
      <web-app>
      <display-name>CEDAR</display-name>
      Comprehensive Environmental Database And Reporting System.
      <welcome-file-list>
      <welcome-file>index.jsp</welcome-file>
      </welcome-file-list>

      <servlet-name>CedarSystem</servlet-name>
      <servlet-class>org.virginiadot.cedar.main.CedarSystem</servlet-class>
      The Core Servlet
      <load-on-startup>1</load-on-startup>

      <servlet-mapping>
      <servlet-name>CedarSystem</servlet-name>
      <url-pattern>/Servlet/CedarSystem</url-pattern>
      </servlet-mapping>
      </web-app>

      I'm using Jboss 3.0.4.

      Thanks,
      Archer