Apart from the basic file upload coding two more jar files are reqd:
 - commons-fileupload-1.2.1.jar
 - commons-io-1.3.2.jar
 i hope version is something not to worry much but better to have latest jar files.
 
 Runtime exceptions occurs in the absence: - HTTP Status 500 -
 1] BOTH jars are unavailable: Unable to load bean org.apache.struts2.dispatcher.multipart.MultiPartRequest (jakarta) - [unknown location]
 2] commons-fileupload-1.2.1.jar unavailable: Unable to load bean org.apache.struts2.dispatcher.multipart.MultiPartRequest (jakarta) - [unknown location]
 3] commons-io-1.3.2.jar unavailable: java.lang.NoClassDefFoundError: org/apache/commons/io/output/DeferredFileOutputStream
 
Apart from these jar files another important key is Interceptor:
Absence of <interceptor-ref name="fileUpload"/> [used in struts.xml]

 By default file-upload functionality works for 2mb now the interceptor plays a vital role while uploading any doc size > 2mb!
 
server message:
SEVERE: org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (3539791) exceeds the configured maximum (2097152)
Jun 10, 2009 2:40:18 PM org.apache.struts2.interceptor.FileUploadInterceptor intercept
SEVERE: the request was rejected because its size (3539791) exceeds the configured maximum (2097152)
Jun 10, 2009 2:40:18 PM org.apache.struts2.dispatcher.Dispatcher serviceAction

browser message:
Struts Problem Report

Struts has detected an unhandled exception:
# Messages:     No result defined for action ui.FileUploadAction and result input
File:     file:/D:/nb/cms/build/web/WEB-INF/classes/struts.xml
Line number:     27
Column number:     73
        <action name="FileUpload" class="ui.FileUploadAction" method="upload">
            <result>/ui/ContentWorkspace.jsp</result>
        </action>

Stacktraces
No result defined for action ui.FileUploadAction and result input - action - file:/D:/nb/cms/build/web/WEB-INF/classes/struts.xml:27:73

Reference: http://www.roseindia.net/struts/struts2/struts-2-file-upload.shtml




Leave a Reply.

    Categories

    All
    5800
    Business Card
    Cardly
    Collaboration Tool
    Fileupload
    Google Wave
    Gtalk
    Java
    Mvc
    Nokia
    Oome
    Servletcentric
    Shortcut
    Struts2
    System
    Website
    Windows
    Zoho

    Archives

    December 2009
    November 2009
    September 2009
    August 2009
    June 2009
    May 2009
    February 2009
    November 2008
    October 2008