This week's book giveaway is in the Python forum.
We're giving away four copies of Hello World and have Warren & Carter Sande on-line!
See this thread for details.
Win a copy of Hello World this week in the Python forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Bear Bibeault
  • Liutauras Vilda
  • Devaka Cooray
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

parse error with web-app when starting tomact

 
Ranch Hand
Posts: 633
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I keep getting the follwoing error when starting tomact:

[ERROR] Digester - -Parse Error at line 25 column 11: The content of element type "web-app" must match "(icon?,displayname?,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*)". <org.xml.sax.SAXParseException:

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-envref*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-local-ref*)".>

The application was running ok, until I added another servlet : SetQueryGroupServlet

and then added the following code to map it in the web.xml

<?xml version="1.0" encoding="UTF-8"?>
<!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>MonitorMaintenance</display-name>
<servlet>
<servlet-name>createANewqueryServlet</servlet-name>
<display-name>createANewqueryServlet</display-name>
<description>Creates a new Query</description>
<servlet-class>com.gfi.monitormaintenance.createANewqueryServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>createANewqueryServlet</servlet-name>
<url-pattern>/servlet/com.gfi.monitormaintenance.createANewqueryServlet</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>SetQueryGroupServlet</servlet-name>
<display-name>SetQueryGroupServlet</display-name>
<description>Sets a group and id</description>
<servlet-class>com.gfi.monitormaintenance.SetQueryGroupServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>SetQueryGroupServlet</servlet-name>
<url-pattern>/servlet/com.gfi.monitormaintenance.SetQueryGroupServlet</url-pattern>
</servlet-mapping>
</web-app>

I cant see what the problem is and why would this error be thrown.

Thanks for any help Tony
 
Tony Evans
Ranch Hand
Posts: 633
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorted the problem out, all servlets needed to be added before servlet mapping :

<?xml version="1.0" encoding="UTF-8"?>
<!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>MonitorMaintenance</display-name>
<servlet>
<servlet-name>createANewqueryServlet</servlet-name>
<display-name>createANewqueryServlet</display-name>
<description>Creates a new Query</description>
<servlet-class>com.gfi.monitormaintenance.createANewqueryServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>SetQueryGroupServlet</servlet-name>
<display-name>SetQueryGroupServlet</display-name>
<description>Sets a group and id</description>
<servlet-class>com.gfi.monitormaintenance.SetQueryGroupServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>createANewqueryServlet</servlet-name>
<url-pattern>/servlet/com.gfi.monitormaintenance.createANewqueryServlet</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>SetQueryGroupServlet</servlet-name>
<url-pattern>/servlet/com.gfi.monitormaintenance.SetQueryGroupServlet</url-pattern>
</servlet-mapping>
</web-app>
 
Life just hasn't been the same since the volcano erupted and now the air is full of tiny ads.
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!