commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Chapple <ryan.chap...@gmail.com>
Subject Re: NoSuchMethodError on ServletFileUpload
Date Fri, 30 Dec 2005 03:14:22 GMT
Martin,

It seems the problem was with Eclipse caching a copy of the old FileUpload
1.0 jar in its .deployables directory, even after I had removed it from the
project.

So, it works now.  Thanks for the help.

Ryan

On 12/29/05, Martin Cooper <martinc@apache.org> wrote:
>
> On 12/28/05, Ryan Chapple <ryan.chapple@gmail.com> wrote:
> >
> > Hey there,
> >
> > I was using v1.0 and had a nice little test servlet running -- I
> upgraded
> > to
> > the v1.1 jar, and now am having a few problems.  I've read the previous
> > posts about making sure that the import statements are right and all,
> and
> > I
> > think I've got that covered.
> >
> > My problem is that when I go to invoke parseRequest on my newly-minted
> > ServletFileUpload object, I get a NoSuchMethod error.
>
>
> Two things to check:
>
> 1) Make sure the FileUpload jar (and the IO jar - see below) is inside
> your
> own web app, and not in a shared location. It's possible that another
> FileUpload jar is interfering.
>
> 2) Do you also have Commons IO 1.1? That is required as of FileUpload 1.1.
>
> --
> Martin Cooper
>
>
> here's the code inside my doPost method:
> >
> > <code>
> >
> > List items = null; // A list of uploaded files
> >
> > // Create a new file upload handler
> >         ServletFileUpload upload = new ServletFileUpload();
> >
> > // Parse the request
> >         try {
> >             items = upload.parseRequest(request);   // <-- Blows up here
> >         } catch (FileUploadException e) {
> >             e.printStackTrace();
> >         }
> >
> > </code>
> >
> > here's the full error as reported by Tomcat:
> >
> > java.lang.NoSuchMethodError:
> > org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest
> > (Lorg/apache/commons/fileupload/RequestContext;)Ljava/util/List;
> >
> >
> > org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(
> > ServletFileUpload.java:116)
> >         com.envolve.web.FileUploadServlet.doPost(FileUploadServlet.java
> > :54)
> >         javax.servlet.http.HttpServlet.service(HttpServlet.java
> > :709)
> >         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> >
> >
> > I'm sure it's something simple that I'm missing, but your help is
> > appreciated!!
> >
> > Thanks,
> >
> > Ryan
> >
> >
>
>

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