• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Upload servelet issues

Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, i got a project that involves uploading file using a servlet. searching on google I found the "commons file upload " of apache. done it, added jar files.

commons-file-upload-1.2.1-bin and

when i first ran the application, it was successful until loading the loading of the file. when i tried to upload it, this error pops up

java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory
java.lang.Class.getDeclaredConstructors0(Native Method)

so i figured that maybe i did not add the jar files to the server. i opened the server and added some jar files
(C:\Program Files\jboss-4.0.5.GA\server\default\lib) I put it there because i seen many jar files there(i think i will be scolded in this....).

i ran the application again. but this time it yielded a differend error.

java.lang.NoClassDefFoundError: org/apache/commons/io/output/DeferredFileOutputStream

what does this one means? do i need to download additional jar files?

done from netbeans 6.5 and Jboss as the server.

here is the code of the file upload servlet.

Posts: 43016
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Commons FileUpload library needs the Commons IO library in order to work. Luckily, the Apache package names are pretty consistently named, so as you get more experienced you'll be able to see what's missing just by looking at the error message.
Led Estonilo
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you very much. yeah it resolved the problem but a new problem arises lol. Ill post a new thread
    Bookmark Topic Watch Topic
  • New Topic