• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Loading .jar files

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi - is it possible that a classloader will load "jar" files which do not have a ".jar" extension? I recently deployed a newly compiled jar file to a server, and renamed the existing jar to "myjarfile.jar.old". But it seems that this jar file was still loaded despite the extension being ".old" - can that be possible? This was code running under a web-app under Resin4.
Thanks
Peter
 
Sheriff
Posts: 22784
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch!

Did you restart the server afterwards? Often applications cache the classes loaded from files until you restart the applications. From experience, Tomcat does this as well (at least by default). Whenever I have to update a library I have to restart the entire Tomcat server.
 
Peter Kirk
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, thanks for the reponse. Yes, I did restart the server. It just seems that jar files (despite the extension not being ".jar") are loaded by the jvm. I was just wondering if this could be correct, or there's something else I've missed.
 
Rob Spoor
Sheriff
Posts: 22784
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, it's certainly possible. The file still is a JAR file, even if you've renamed it. And JAR files in turn are just ZIP files. Perhaps it would help if you rename it to .txt, tricking the server into thinking it's a text file, but the safest option is to simply move it elsewhere.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic