Tomcat 4.1.24 comes with commons-fileupload-1.0-beta-1.jar bundled in the $CATALINA_HOME/server/lib directory. Tomcat needs this file to work, and also this version because the interface changed between this beta and the 1.0 final release. Tomcat is relying on the interface from the beta version (this may explain the NoSuchMethodError), so this file should be left where it is.
If you wish your webapp to use the 1.0 release version of commons-fileupload, you can put in the WEB-INF/lib directory inside the .war file, or if you wish to share between several webapps, you can place the file in $CATALINA_HOME/shared/lib So, you may actually need 2 copies of commons-fileupload to get your application working: $CATALINA_HOME/server/lib/commons-fileupload-1.0-beta-1.jar $CATALINA_HOME/shared/lib/commons-fileupload-1.0.jar -----Original Message----- From: Rhino [mailto:[EMAIL PROTECTED] Sent: 22 July 2003 17:59 To: Tomcat Users List Subject: Re: Weird Problems installing servlets in Tomcat ----- Original Message ----- From: "John Turner" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Tuesday, July 22, 2003 10:22 AM Subject: Re: Weird Problems installing servlets in Tomcat > Rhino wrote: > > > > > I'm still relatively new to Tomcat and Linux so I may be asking stupid > > questions; if so, I don't mean to be. I'm just trying to understand what's > > going wrong. It's very possible that I've made some kind of newbie mistake; > > I'm just trying to understand what it is and how to fix it. > > Move the JAR file to where it should be, like $CATALINA_HOME/lib or > $CATALINA_HOME/common/lib as described in the ClassLoader HOWTO. > I have had no luck getting Tomcat to load War files yet; I've been trying various things for hours but no joy yet.... First of all, I made a big mistake when I told you earlier that commons-fileupload-1.0.jar was in /var/tomcat4/server/lib, AKA $CATALINA_HOME/server/lib. I just plain looked at the wrong darned line of the screen. In fact, commons-fileupload-1.0.jar was in $CATALINA_HOME/common/lib (and still is). I think that's where I want it, right? Tomcat uses FileUpload itself doesn't it? Otherwise I would put it in the /shared path, right? I've been reading the HOWTO that you cited and I'm getting a bit confused; it seems to contradict both itself and you! According to the Quick Start section, JAR files containing resource which are to be shared across all web applications are to be placed in $CATALINA_HOME/shared/lib. Later, in the detailed description of the class loaders, it says that JAR resources which need to be shared across all web applications (except Tomcat itself) should be put in $CATALINA_HOME/lib, not shared/lib. I suspect that the Quick Start is wrong because it I don't even have a $CATALINA_HOME/shared/lib on the server. That assumption would also agree with your remarks which say to use $CATALINA_HOME/lib. The only problem is that I don't have a $CATALINA_HOME/lib either! (We are using Tomcat 4.1.24 on Linux Mandrake 9.1 and running Tomcat as a service.) Anyway, this is probably all a bit off point anyway; I should have commons-fileupload-1.0.jar in /common/lib, right? There's one other thing that I didn't post earlier which I'm starting to suspect is fairly critical. When I first copied commons-fileupload-1.0.jar into the $CATALINA_HOME/commons/lib, I noticed that there was already a jar in that directory with the name commons-upload.jar. I assumed that was an old version of the jar and deleted it. The reason I think this might have been a major mistake was that nothing worked right from that point on. I have been unable to install a single WAR file, even one whose servlets did no FileUploads, since the point where I copied commons-fileupload-1.0 jar into /commons/lib and deleted the commons-fileupload.jar. Could that really be the cause of my problems? If yes, what do I do about it? Do I need to find a copy of commons-fileupload.jar and put it into /commons/lib? If yes, what do I do about commons-fileupload-1.0.jar? Should it be in /common/lib as well? But won't that cause conflicts? I hope this note isn't too incoherent; I'm fairly confused right now and may not be making quite as much sense as I would like.... Rhino --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]