jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cumbers <r...@kent.ac.uk>
Subject Strange web.xml
Date Mon, 13 Dec 2004 18:49:08 GMT
Hey guys

I am trying to get cactus to work with ant. My earlier post has been 
solved, it was a content.xml file that was the problem.

My current Problem is this:

I am using the following to ant target to create the cactified war file:

<target name="development.test.prepare" 
depends="development-create-war, compile.cactus">
<!-- Cactify the war file -->
   <cactifywar srcfile="${target.dir}/rms_dev.war"
              destFile="${target.dir}/rms-dev-cactified.war">
     <classes dir="${target.classes.cactus.dir}"/>
     <lib file="${httpunit.jar}"/>
   </cactifywar>
   <mkdir dir="${target.testreports.dir}"/>
   <mkdir dir="${target.testreports.dir}/tomcat5x"/>
</target>

This will work if I do not have any reference to ServletRedirector in my 
web.xml. However in the logs that the running of this cactified war 
target generates I see the following:

13-Dec-2004 18:18:28 org.apache.catalina.startup.ContextConfig 
applicationConfig
SEVERE: Parse error in application web.xml
java.lang.IllegalArgumentException: Servlet mapping specifies an unknown 
servlet name ServletRedirector
         at 
org.apache.commons.digester.Digester.createSAXException(Digester.java:2540)
         at 
org.apache.commons.digester.Digester.createSAXException(Digester.java:2566)
         at 
org.apache.commons.digester.Digester.endElement(Digester.java:1061)

Which I take to mean that the web.xml is not formed correctly, i take a 
look at the web.xml file that is deployed from the cactified war file 
and here it is:

<web-app>
     <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>
     <session-config>
         <session-timeout>30</session-timeout>
     </session-config>
     <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>rmsDispatcher</servlet-name>
         <servlet-class>com.sun.rms.tracking.RMSDispatcher</servlet-class>
     </servlet>
     <servlet>
         <servlet-name>ServletRedirector</servlet-name>
<servlet-class>org.apache.cactus.server.ServletTestRedirector</servlet-class>
     </servlet>
     <servlet-mapping>
         <servlet-name>rmsDispatcher</servlet-name>
         <url-pattern>/RMSDispatcher/*</url-pattern>
     </servlet-mapping>
     <welcome-file-list>
         <welcome-file>index.jsp</welcome-file>
         <welcome-file>index.html</welcome-file>
         <welcome-file>index.htm</welcome-file>
     </welcome-file-list>
     <resource-ref>
         <description>postgreSQL Datasource example</description>
         <res-ref-name>jdbc/postgres</res-ref-name>
         <res-type>javax.sql.DataSource</res-type>
         <res-auth>Container</res-auth>
     </resource-ref>
</web-app>

Notice that the ServletRedirector is declared, but only AFTER the 
<servlet-mapping> tag that corresponds with the ServletRedirector. 
Should the <Servlet> declaration be declared before the 
<servlet-mapping> tags. If so, why is cactus and ant getting it so wrong!

I have been working on this problem all day and it is slowly removing my 
will to live, any help is much appreciated!

Cheers

Rich

Mime
View raw message