jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Korver, Aaron" <Aaron.Kor...@Fiserv.com>
Subject RE: Strange web.xml
Date Mon, 13 Dec 2004 18:48:24 GMT
Here is my deployment descriptor which works fine with Ant.  Notice that the
<servlet> tags are all before the <servlet-mapping> tags.

<web-app id="WebApp">
	<display-name>CactusWeb</display-name>
	<servlet>
		<servlet-name>ServletRedirector</servlet-name>
		<display-name>ServletRedirector</display-name>
	
<servlet-class>org.apache.cactus.server.ServletTestRedirector</servlet-class
>
		<load-on-startup>1</load-on-startup>
	</servlet>
	<servlet>
		<servlet-name>ServletTestRunner</servlet-name>
		<display-name>ServletTestRunner</display-name>
	
<servlet-class>org.apache.cactus.server.runner.ServletTestRunner</servlet-cl
ass>
		<init-param>
			<param-name>xsl-stylesheet</param-name>
			<param-value>styles/cactus-report.xsl</param-value>
		</init-param>
		<load-on-startup>2</load-on-startup>
	</servlet>
	<servlet-mapping>
		<servlet-name>ServletRedirector</servlet-name>
		<url-pattern>/ServletRedirector</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>ServletTestRunner</servlet-name>
		<url-pattern>/ServletTestRunner</url-pattern>
	</servlet-mapping>
</web-app>

> -----Original Message-----
> From: Cumbers [mailto:rlc5@kent.ac.uk]
> Sent: Monday, December 13, 2004 12:49 PM
> To: Cactus Users List
> Subject: Strange web.xml
> 
> 
> 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(Digest
> er.java:2540)
>          at 
> org.apache.commons.digester.Digester.createSAXException(Digest
> er.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</f
ilter-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
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: cactus-user-help@jakarta.apache.org
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message