On 12/28/05, Ryan Chapple <[EMAIL PROTECTED]> 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
>
>