File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Apache File Upload in Servlet

 
sudha swami
Ranch Hand
Posts: 186
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

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?



Any help is appreciated.

Thanks
Sudha
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "set the classpath and runtime path"? Why wouldn't you keep the jar file in the WEB-INF/lib directory of your web app?
 
Ivan Jozsef Balazs
Rancher
Posts: 972
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64196
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have verified that problems are caused when the jar is included in each web app?
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
sudha swami
Ranch Hand
Posts: 186
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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.

Thanks
Sudha
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Keeping different version of a library in the classpath at the same time is just asking for trouble.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64196
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, it's kind of like using a match to try and see if the gas tank is empty. It's gonna blow up on you, probably sooner rather than later.
 
sudha swami
Ranch Hand
Posts: 186
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank You Bear
 
sudha swami
Ranch Hand
Posts: 186
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Do I need to use the latest version of jar files? Remove the older version.

Thanks
Sudha
 
Naveen Kumar Kumar
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sudha,

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.

Take required backups in case of any issues...!!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic