You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-dev@jakarta.apache.org by bu...@apache.org on 2003/07/01 18:25:26 UTC

DO NOT REPLY [Bug 21237] New: - CactifyWarTask duplicates init-param lines in existing web.xml sevlet tag

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21237>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21237

CactifyWarTask duplicates init-param lines in existing web.xml sevlet tag

           Summary: CactifyWarTask duplicates init-param lines in existing
                    web.xml sevlet tag
           Product: Cactus
           Version: Nightly Build
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Ant Tasks
        AssignedTo: cactus-dev@jakarta.apache.org
        ReportedBy: anilm2@yahoo.com


When running cactifywar against an existing web.xml file that contains
a <servlet> tag it appears as if the CactifyWar task is duplicating all of the
<init-param> tags within that servlet tag.

This becomes a big problem when there are other elements that belong after the
<init-params> tag (such as a <load-on-startup> tag, in my instance), because it
causes the WAR deployment to fail because of the invalid <Servlet> in the web.xml.

This means that the <cactus> tag then just hangs there waiting to use a servlet
on a WAR file that hasn't deployed.


the original servlet line from my web.xml:
    <servlet>
        <servlet-name>action</servlet-name>
        <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
        <init-param>
          <param-name>application</param-name>
          <param-value>net.trusecure.tes.servlet.ApplicationResources</param-value>
        </init-param>
        <init-param>
            <param-name>config</param-name>
            <param-value>/WEB-INF/struts-config.xml</param-value>
        </init-param>
        <init-param>
            <param-name>debug</param-name>
            <param-value>2</param-value>
        </init-param>
        <load-on-startup>2</load-on-startup>
    </servlet>

'cactified' version:
<servlet>         <servlet-name>action</servlet-name>        
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>        
<init-param>           <param-name>application</param-name>          
<param-value>net.trusecure.tes.servlet.ApplicationResources</param-value>      
  </init-param>         <init-param>             <param-name>config</param-name>
            <param-value>/WEB-INF/struts-config.xml</param-value>        
</init-param>         <init-param>             <param-name>debug</param-name>  
          <param-value>2</param-value>         </init-param>        
<load-on-startup>2</load-on-startup>    
<init-param><param-name>application</param-name><param-value>net.trusecure.tes.servlet.ApplicationResources</param-value></init-param><init-param><param-name>config</param-name><param-value>/WEB-INF/struts-config.xml</param-value></init-param><init-param><param-name>debug</param-name><param-value>2</param-value></init-param></servlet>




Notice that the init-params are duplicated.  They are also jammed back into the
servlet AFTER the load-on-startup tag.  The duplication does not appear to be
related to the <load-on-startup> tag (I have tried without the load-on-startup
tag, and the params are still duplicated).

So, it's most likely that someone accidentally re-used a variable or something.

thanks.

btw,  It wouldn't hurt to throw some new-lines into the cactified web.xml file
to make it more readable.

---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-dev-help@jakarta.apache.org