Help with Jakarta File Upload and Apache Tomcat

Discussion in 'Java' started by nushio@gmail.com, Sep 8, 2006.

  1. Guest

    Hello.

    I've been searching for a simple way to upload a file to a webserver,
    and found Jakarta Commons FileUpload as an easy solution.

    My problem, however, is that it isnt found on run-time.

    "java.lang.NoClassDefFoundError:
    org/apache/commons/fileupload/FileUploadException" is the Root Cause.

    I have already set up the commons-fileupload-1.1.1.jar on the Eclipse
    build path, and a copy of it on web-inf\lib.

    All this has left me right where I started, stuck without uploading
    files. Any help is greatly appreciated.

    -Nushio
     
    , Sep 8, 2006
    #1
    1. Advertising

  2. Hi,

    Did you restart your tomcat/redeploy your webapp after doing so? To be
    sure, put the jar in $TOMCAT_HOME\server\lib too and bounce tomcat.

    -cheers,
    Manish

    wrote:
    > Hello.
    >
    > I've been searching for a simple way to upload a file to a webserver,
    > and found Jakarta Commons FileUpload as an easy solution.
    >
    > My problem, however, is that it isnt found on run-time.
    >
    > "java.lang.NoClassDefFoundError:
    > org/apache/commons/fileupload/FileUploadException" is the Root Cause.
    >
    > I have already set up the commons-fileupload-1.1.1.jar on the Eclipse
    > build path, and a copy of it on web-inf\lib.
    >
    > All this has left me right where I started, stuck without uploading
    > files. Any help is greatly appreciated.
    >
    > -Nushio
     
    Manish Pandit, Sep 8, 2006
    #2
    1. Advertising

  3. Guest

    Thanks for your quick response.

    Yes, I did restart tomcat, cleaned and re built the webapp, and I just
    placed commons-fileupload-1.1.1.jar on $TOMCAT_Home\server\lib, with no
    luck, same error.

    Any other suggestions?

    TIA!
    -Nushio
    Manish Pandit wrote:
    > Hi,
    >
    > Did you restart your tomcat/redeploy your webapp after doing so? To be
    > sure, put the jar in $TOMCAT_HOME\server\lib too and bounce tomcat.
    >
    > -cheers,
    > Manish
    >
    > wrote:
    > > Hello.
    > >
    > > I've been searching for a simple way to upload a file to a webserver,
    > > and found Jakarta Commons FileUpload as an easy solution.
    > >
    > > My problem, however, is that it isnt found on run-time.
    > >
    > > "java.lang.NoClassDefFoundError:
    > > org/apache/commons/fileupload/FileUploadException" is the Root Cause.
    > >
    > > I have already set up the commons-fileupload-1.1.1.jar on the Eclipse
    > > build path, and a copy of it on web-inf\lib.
    > >
    > > All this has left me right where I started, stuck without uploading
    > > files. Any help is greatly appreciated.
    > >
    > > -Nushio
     
    , Sep 8, 2006
    #3
  4. Can you post the exception trace, with the code snippet that causes it?
     
    Manish Pandit, Sep 8, 2006
    #4
  5. Nushio Guest

    Thanks to Manish Pandit, I've managed to fix my error.

    I'm posting here in case anyone else stumbles upon this problem.

    I had placed the lib file inside the web-inf folder, but that was the
    problem. Instead, I should have imported it via Eclipse, as a Jar, and
    NOT as an External Jar.

    Once that was done, the program executed succesfully.

    Thanks again, Manish!
    -Nushio
    Manish Pandit wrote:
    > Can you post the exception trace, with the code snippet that causes it?
     
    Nushio, Sep 8, 2006
    #5
  6. sharad1986

    Joined:
    Jul 31, 2007
    Messages:
    2
    but nushio that is only possible if that jar is present in some other project. i think what you did was write the only wrong thing you did was that you copied the file in the WEB INF folder and than you imported it via external jar option. so you were actually having duplicate jar problem which was hindering you. what you did with placing in web inf folder was only right since that is only needed and since tomcat support this package so it already have the jar file.

    the jar must be present inside the web library..,
     
    Last edited: Jul 31, 2007
    sharad1986, Jul 31, 2007
    #6
  7. Wig

    Joined:
    Oct 7, 2010
    Messages:
    1
    Thanks a ton!

    I am very appreciative of your form upload example. Works like a charm.
     
    Wig, Oct 7, 2010
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sean Burke
    Replies:
    0
    Views:
    591
    Sean Burke
    Sep 1, 2003
  2. Ashwin
    Replies:
    0
    Views:
    389
    Ashwin
    Jan 6, 2004
  3. Joshua
    Replies:
    0
    Views:
    566
    Joshua
    Oct 20, 2004
  4. Replies:
    1
    Views:
    16,471
  5. untung
    Replies:
    0
    Views:
    449
    untung
    Oct 7, 2009
Loading...

Share This Page