commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michel de Lange <michel_de_la...@yahoo.co.uk>
Subject org.apache.commons.fileupload.FileUploadException: Processing of multipart/form-,data request failed. Connection rese
Date Wed, 26 Nov 2008 08:35:37 GMT
Dear all,


I would much appreciate it if you could tell me what is going wrong for 
me, or at least give me help as to how I may find out more information.


I have an application with a file upload. When I deploy it in Tomcat 6, 
I get this exception:


org.apache.commons.fileupload.FileUploadException: Processing of 
multipart/form-
data request failed. Connection reset
        at 
org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadB
ase.java:384)
        at 
org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(
ServletFileUpload.java:116)
        at 
ac.otago.flags.server.FileUploadServlet.doPost(FileUploadServlet.java
:*68*)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:290)
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
        at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:233)
        at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:175)
etc.


My code looks like this:

    protected void doPost(HttpServletRequest request,
            HttpServletResponse response) throws ServletException, 
IOException {

        try {
            ServletRequestContext ctx = new ServletRequestContext(request);

            if (ServletFileUpload.isMultipartContent(ctx) == false) {
                sendResponse(response, new FormResponse(
                        HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
                        "The servlet can only handle multipart requests."
                                + " This is probably a software bug."));
                return;
            }

            // Create a new file upload handler
            ServletFileUpload upload = new ServletFileUpload(
                    new DiskFileItemFactory());

            // Parse the request
            *List<FileItem> items = 
upload.parseRequest(request);          // this is the offending line 68*

            Iterator<FileItem> i = items.iterator();
            HashMap<String, String> params = new HashMap<String, String>();
            HashMap<String, File> files = new HashMap<String, File>();
            int count = 0;


It may not be relevant, but I have developed the application with GWT 
(Google Web Tools). This comes with a hosted mode (which also uses 
Tomcat) and that works fine. When I deploy to Tomcat outside of GWT, I 
get this exception. I have checked all my jar files, and I believe they 
are the same in both environments.  I use commons-fileupload-1.1.1 and 
commons-io-1.3.2

Many thanks for your help.


Michel


		
___________________________________________________________ 
Try the all-new Yahoo! Mail. "The New Version is radically easier to use" – The Wall Street
Journal 
http://uk.docs.yahoo.com/nowyoucan.html


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message