Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 578809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:17:59+00:00 2026-05-13T14:17:59+00:00

Apache returns this error while trying to upload a file (I only kept the

  • 0

Apache returns this error while trying to upload a file (I only kept the first lines of the stacktrace and root causes):

HTTP Status 500 - 
type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Exception in JSP: /upload.jsp:40

    37:      
    38:        try {
    39: 
    40:            items = upload.parseRequest(request);
    41:        } catch (FileUploadException e) {
    42:            out.println(e);
    43:        }

Stacktrace:
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

root cause

javax.servlet.ServletException: org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(Lorg/apache/commons/fileupload/RequestContext;)Ljava/util/List;

root cause

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:126)

Here is my code:

if(ServletFileUpload.isMultipartContent(request)){
 FileItemFactory factory = new DiskFileItemFactory();
   ServletFileUpload upload = new ServletFileUpload(factory);
   List items = null;


   try {

       items = upload.parseRequest(request);
   } catch (FileUploadException e) {
       out.println(e);
   }
}

I dont get it, it looks like it can’t find the parseRequest() method, but the ServletFileUpload instanciation works fine, so it seems like the package is there but…

Any idea?
All suggestions help appreciated! 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T14:18:00+00:00Added an answer on May 13, 2026 at 2:18 pm

    This is indeed a sign of classpath pollution. You have different versions of the commons fileupload JAR file spreading over the classpath. You need to clean up the classpath by removing or replacing the older-versioned ones. In case of a JSP/Servlet webapplication, the default paths which are covered by the classpath are usually the Webapp/WEB-INF/lib, Webapp/WEB-INF/classes, Appserver/lib and the JRE/lib.

    That said, the stacktrace also indicates that you wrote raw Java code inside JSP files using the old fashioned scriptlets. I would strongly recommend not to do so, but just to use a real Java class (in this case a Servlet) to handle the file upload.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've encountered the following bug: http://issues.apache.org/jira/browse/AXIS2-4363 It states the following: This error only occurs
From one apache server file_get_contents returns the contents of a url straight away. On
Apache just fails to start with NO error message when we try to reboot
On Apache/PHP sites if I want to put a senstive file within my website
I've got an Apache server that has one access log file that is topping
I got this error Fatal error: Call to a member function set_prefix() on a
Apache XMLBeans can be used to generate Java classes and interfaces from XML Schema
Using Apache's commons-httpclient for Java, what's the best way to add query parameters to
I've used Apache CXF to expose about ten java classes as web services. I've
I have apache 2.2 and tomcat 5.5 running on a Windows XP machine. Which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.