Help with Jakarta File Upload and Apache Tomcat

N

nushio

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
 
M

Manish Pandit

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
 
N

nushio

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
 
N

Nushio

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
 
Joined
Jul 31, 2007
Messages
2
Reaction score
0
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:

Wig

Joined
Oct 7, 2010
Messages
1
Reaction score
0
Thanks a ton!

I am very appreciative of your form upload example. Works like a charm.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top