I am using Apache File Upload in Servlet. Long before, I set the classpath and runtime path with commons-fileupload.jar .Now I need to use the same apache file upload for different Servlet. Now I want to use the latest version i.e. commons-fileupload-1.2.2.jar. Do I need to delete the old jar file from the classpath and build path inorder to use the latest one?
Ulf Dittmer wrote:Why wouldn't you keep the jar file in the WEB-INF/lib directory of your web app?
Maybe it will be used in more web apps and there is a wish to avoid the resource hogging due to including the same jars in every web app's lib.
For the projects I work in, we agree upon not including the same axis stuff. etc. in every web app.
Ivan, let's not assume what sudha's problem might be. And anyway, the Commons libraries are small, whether they're loaded once or ten times is not much of a difference given the RAM available these days.
Joined: Apr 24, 2007
I kept the older version of the jar file and the new version in the WEB-INF/lib folder. Is it OK if both the versions are existing in the same folder. I didn't see any problems yet. Will I see any problems in my application because of the 2 versions.
Joined: Mar 22, 2005
Keeping different version of a library in the classpath at the same time is just asking for trouble.
Are trying to use the new version of jar for some other servlet, say Servlet2, in the same web app whereas there are existing servlets say Servlet1, which still uses old jars??
If that is the case, then first check the updates included in the new jar, it could support the features present in the old jar. In such case, you can rename/delete the old jar and include the new jar and update build path to refer to this new jar. Make sure the project is build again.