You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Rhino <rh...@sympatico.ca> on 2003/07/10 23:20:12 UTC

[FileUpload] Installing in Eclipse

Can anyone tell me how/where to install FileUpload so that it works in Eclipse?

I am running Eclipse on Windows XP and have Tomcat 4.1.24 and Sysdeo V2.1 installed on my system. Every time I run my simple file upload servlet, I get this (plus more stacktrace) as the root cause in the exception that is thrown: 

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

I posted about this a few days ago and tried everything that was suggested without success. The last suggestion that I got said that I may have installed the FileUpload code incorrectly. As a result, I downloaded and installed the new 2.1.1 version of Eclipse, migrated my projects over to the new version of Eclipse, then tried my servlet again. I got the same error again!

I'm pretty bad at installing things so I've probably just done something boneheaded that is obvious to everyone but me. That's why I'm posting here; maybe one of you folks can see what I'm doing wrong.

My newest version of Eclipse is installed at D:\eclipse. The version of Tomcat used by this new copy of Eclipse is at D:\jakarta-tomcat-4.1.24. My CATALINA_HOME environment variable has been changed to point to D:\jakarta-tomcat-4.1.24. The commons-fileupload-1.0.jar file is at D:\jakarta-tomcat-4.1.24\common\lib.

What do I have to do or change to make this work? I can compile fine but I can't run this servlet at all, not even once.

This feels like a dumb question but I've been looking at docs for quite a while now and still can't find this answered clearly anywhere.

Rhino
---
rhino1 AT sympatico DOT ca
"If you want the best seat in the house, you'll have to move the cat."

Re: [FileUpload] Installing in Eclipse

Posted by Martin Cooper <ma...@apache.org>.
As Brian said, keep the FileUpload jar within your own web app, and don't
try to share it by putting it in common/lib. Since Tomcat has its own
(pre-1.0) copy of FileUpload somewhere, I strongly suspect that the problems
you are seeing are the result of confusion between the 2 different versions
of FileUpload.

--
Martin Cooper


"Rhino" <rh...@sympatico.ca> wrote in message
news:01a601c34729$0c8f6060$0d02a8c0@athlon...
Can anyone tell me how/where to install FileUpload so that it works in
Eclipse?

I am running Eclipse on Windows XP and have Tomcat 4.1.24 and Sysdeo V2.1
installed on my system. Every time I run my simple file upload servlet, I
get this (plus more stacktrace) as the root cause in the exception that is
thrown:

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

I posted about this a few days ago and tried everything that was suggested
without success. The last suggestion that I got said that I may have
installed the FileUpload code incorrectly. As a result, I downloaded and
installed the new 2.1.1 version of Eclipse, migrated my projects over to the
new version of Eclipse, then tried my servlet again. I got the same error
again!

I'm pretty bad at installing things so I've probably just done something
boneheaded that is obvious to everyone but me. That's why I'm posting here;
maybe one of you folks can see what I'm doing wrong.

My newest version of Eclipse is installed at D:\eclipse. The version of
Tomcat used by this new copy of Eclipse is at D:\jakarta-tomcat-4.1.24. My
CATALINA_HOME environment variable has been changed to point to
D:\jakarta-tomcat-4.1.24. The commons-fileupload-1.0.jar file is at
D:\jakarta-tomcat-4.1.24\common\lib.

What do I have to do or change to make this work? I can compile fine but I
can't run this servlet at all, not even once.

This feels like a dumb question but I've been looking at docs for quite a
while now and still can't find this answered clearly anywhere.

Rhino
---
rhino1 AT sympatico DOT ca
"If you want the best seat in the house, you'll have to move the cat."




Re: [FileUpload] Installing in Eclipse

Posted by Brian Cook <bc...@printtime.com>.
The .jar file needs to be in a directory labeled 'lib' in the same 
directory as the 'classes' folder that your servlet class files are in. 
  Or last lest that is how I got it to work on my boxes.  So assuming 
that your servlet is in the ROOT directory in webapps it would go in.


D:\jakarta-tomcat-4.1.24\webapps\ROOT\WEB-INF\lib\

or

D:\jakarta-tomcat-4.1.24\webapps\<<DIRECTORY_YOUR_CLASS_FILES_ARE_IN>>\WEB-INF\lib\

 From my understanding it should work if you put it in your CLASSPATH too.