as_taous
as_taous

Reputation: 113

NoClassDefFoundError when using commons-fileupload

I use commons-fileupload-1.1.1 and commons-io-1.3.2 to upload/download files in a web application with java 6. In localhost, it runs correctly because I have the 2 jars in my lib (server\default\lib) (I use jboss 4).

When I deploy the application in the server, I have an exception when I try to upload/download files:

java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileUploadException

The one difference between localhost and the server is: in the server, I have not the 2 jars.

When I change the classpath of the project and I add the two jars, I deploy the application --> I have the same exception.

Any suggestions?

Upvotes: 0

Views: 931

Answers (1)

Buhake Sindi
Buhake Sindi

Reputation: 89189

There are 2 ways of going about this:

  1. Application specific: Add your 2 jars in your project's WEB-INF/lib folder, build your project and deploy.
  2. Alternatively, try the JBOSS_4_AS\server\all\lib folder. That way, all applications deployed in your JBOSS 4 Application server can see the 2 jars.

I hope this helps.

Upvotes: 1

Related Questions