MaxLengthExceededException causes application deployment to fail
 Technote (troubleshooting)
 
Problem(Abstract)
Applications larger than 250 MB fail to deploy with a MaxLengthExceededException.
 
Cause
Applications larger than 250 MB fail to deploy. A restriction on the application size is imposed to avoid security attacks on the administrative console. For example, an unauthorized user who gains access to the console configurator role might try to deploy large applications in an attempt to disable WebSphere® Application Server. The application size restriction is meant to prevent this type of threat.

Exception in the SystemOut.log file.

[8/23/04 14:34:06:011 EDT] 621c8fa3 WebGroup E SRVE0026E: [Servlet
Error]-[Problem while reading request: The maximum length of 262144000  
bytes has been exceeded]:
org.apache.struts.upload.MaxLengthExceededException: The maximum length
of 262144000 bytes has been exceeded  at
org.apache.struts.upload.BufferedMultipartInputStream.<init>(BufferedMultipartInputStream.java:86)
at com.ibm.ws.console.core.upload.MultipartIterator.parseRequest(MultipartIterator.java:321)
at com.ibm.ws.console.core.upload.MultipartIterator.<init>(MultipartIterator.java:160)
at com.ibm.ws.console.core.upload.DiskMultipartRequestHandler.handleRequest
(DiskMultipartRequestHandler.java:72)
at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:739)
at  org.apache.struts.action.ActionServlet.processPopulate(ActionServlet.java:2065)

 
Resolving the problem
To configure the maximum application size, follow these steps.
For WebSphere Application Server 5.0 and 5.1:
  1. Edit the web.xml file, which is located at:
    Install_Root \config\cells\cellName\applications\adminconsole.ear
    \deployments\adminconsole\adminconsole.war\WEB-INF\


  2. Add the following init parameter to the action servlet as follows. The maxFileSize value can be determined based on the size of the application to be installed; in this case it is 500 MB.


    <init-param id="InitParam_1037062316924">
    <param-name> maxFileSize </param-name>
    <param-value> 500M </param-value>
    </init-param>


    This init parameter can be added after the org.apache.struts.tiles.ActionComponentServlet.

    For example:

    <servlet id="Servlet_1037062312313">
    <servlet-name>action</servlet-name>
    <servlet-class>org.apache.struts.tiles.ActionComponentServlet</servlet-class>
    <init-param id="InitParam_1037062316924">
    <param-name> maxFileSize </param-name>
    <param-value> 500M </param-value>
    </init-param>


    The value of maxFileSize can be represented in bytes by not appending any characters to the end. For kilobytes, append a "K". For megabytes, append an "M" and for gigabytes append a "G".

  3. Restart the Application Server.

  4. Redeploy the application.


For WebSphere Application Server 6.0 and 6.1

To enable installation of an application larger than 250 MB, follow these steps:
  1. Stop the server.

  2. Open in editor file: 6.0.x
    Was60-root/SystemApps/adminconsole.ear/adminconsole.war/WEB-INF/web.xml
  3. Open in editor file: 6.1.x
    Was61-root
    /systemApps/isclite.ear/isclite.war/WEB-INF/web.xml
  4. Add the init paramenter to the action servlet:

    Modify:
    <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/struts-config.xml</param-value>
    </init-param>
    <load-on-startup>2</load-on-startup>
    </servlet>

    To:
    <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/struts-config.xml</param-value>
    </init-param>                      
    <init-param id="InitParam_1037062312313">  
    <param-name>maxFileSize</param-name>  
    <param-value>500M</param-value>            
    </init-param>          
    <load-on-startup>2</load-on-startup>    
    </servlet>


  5. Restart the Application Server.

  6. Deploy the application.
 
 
Cross Reference information
Segment Product Component Platform Version Edition
Application Servers Runtimes for Java Technology Java SDK
 
 


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > Deploy (for example: AAT or ANT or EAR/WAR/JAR)
Operating system(s): Windows
Software version: 5.1.1.1
Software edition:
Reference #: 1179992
IBM Group: Software Group
Modified date: Feb 19, 2008