Invalid element 'servlet' in content of 'web-app', expected elements [.....

I'm receiving the following error when I build a web app.

Invalid element 'servlet' in content of 'web-app', expected elements [.....

I have been trying to configure cactus struts testing as described here:

http://jakarta.apache.org/cactus/integration/howto_config.html.

I've a feeling it's a problem with my web.xml file (perhaps the order I have defined the elements) can anyone help?

My web.xml is as follows

<web-app>

<description>web.xml file for Scorecards Application</description>

<filter>

<filter-name>FilterRedirector</filter-name>

<filter-class>org.apache.cactus.server.FilterTestRedirector</filter-class>

</filter>

<filter-mapping>

<filter-name>FilterRedirector</filter-name>

<url-pattern>/FilterRedirector</url-pattern>

</filter-mapping>

<servlet>

<servlet-name>ServletRedirector</servlet-name>

<servlet-class>org.apache.cactus.server.ServletTestRedirector</servlet-class>

</servlet>

<servlet>

<servlet-name>JspRedirector</servlet-name>

<jsp-file>/jspRedirector.jsp</jsp-file>

</servlet>

<servlet-mapping>

<servlet-name>ServletRedirector</servlet-name>

<url-pattern>/ServletRedirector</url-pattern>

</servlet-mapping>

<servlet-mapping>

<servlet-name>JspRedirector</servlet-name>

<url-pattern>/JspRedirector</url-pattern>

</servlet-mapping>

<servlet>

<servlet-name>action</servlet-name>

<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>

<init-param>

<param-name>config</param-name>

<param-value>/WEB-INF/config/struts-config.xml</param-value>

</init-param>

<init-param>

<param-name>debug</param-name>

<param-value>2</param-value>

</init-param>

<init-param>

<param-name>detail</param-name>

<param-value>2</param-value>

</init-param>

<init-param>

<param-name>validate</param-name>

<param-value>true</param-value>

</init-param>

<load-on-startup>1</load-on-startup>

</servlet>

<servlet-mapping>

<servlet-name>action</servlet-name>

<url-pattern>*.do</url-pattern>

</servlet-mapping>

<session-config>

<session-timeout>30</session-timeout>

</session-config>

<mime-mapping>

<extension>html</extension>

<mime-type>text/html</mime-type>

</mime-mapping>

<mime-mapping>

<extension>txt</extension>

<mime-type>text/plain</mime-type>

</mime-mapping>

<welcome-file-list>

<welcome-file>index.jsp</welcome-file>

</welcome-file-list>

<taglib>

<taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>

<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>

</taglib>

<taglib>

<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>

<taglib-location>/WEB-INF/struts-html.tld</taglib-location>

</taglib>

<taglib>

<taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>

<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>

</taglib>

<taglib>

<taglib-uri>/WEB-INF/struts-tiles.tld</taglib-uri>

<taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>

</taglib>

<resource-ref>

<description>SCR Production Data Connection</description>

<res-ref-name>jdbc/SCRproductionDS</res-ref-name>

<res-type>javax.sql.DataSource</res-type>

<res-auth>Container</res-auth>

</resource-ref>

</web-app>

[4376 byte] By [StrutFoola] at [2007-10-2 5:15:03]
# 1
I don't think you are allowed to mix the servlet mapping entries in among the servlet entries. You should do all the servlet entries and then all the servlet mapping entries.
tolmanka at 2007-7-16 1:17:31 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Thanks! you were correct
StrutFoola at 2007-7-16 1:17:31 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...