Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

Apache File Upload in Servlet

 
Ranch Hand
Posts: 186
  • 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
 
Rancher
Posts: 43011
76
  • 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?
 
Rancher
Posts: 1041
6
  • 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.
 
Marshal
Posts: 67366
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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
Posts: 43011
76
  • 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
  • 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
Posts: 43011
76
  • 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
Marshal
Posts: 67366
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank You Bear
 
sudha swami
Ranch Hand
Posts: 186
  • 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
 
Greenhorn
Posts: 19
  • 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...!!
 
Put the moon back where you found it! We need it for tides and poetry and stuff. Like this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!