• 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

how to load a new jar file while server is running

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I need to place a new jar file into lib while server is running.
How can we load this jar(entirely a new file) into tomcat's current classpath without restarting the server.

Could you anyone help me out.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can restart the webapp itself, without restarting all of Tomcat from the Tomcat manager.
 
kiranrredy ad
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ben Souther:
You can restart the webapp itself, without restarting all of Tomcat from the Tomcat manager.



Ben,
Thanks a lot.

Can we do the same action programatically without using tomcat manager?
 
kiranrredy ad
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ben,
Thanks a lot.

Can we do the same action programatically without using tomcat manager?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could if you wrote your own custom class loader or, if you set your app to privileged, you could do whatever is is that the manager app does when it restarts an app. It's open source so you can look for yourself.

There is also another option of the <Context .../> element that allow you to make your app reloadable. This will cause the app to be reloaded any time a class file or jar file is uploaded. There is a small performance penalty but it's never been noticable to me.

See: http://tomcat.apache.org/tomcat-5.5-doc/config/context.html
 
kiranrredy ad
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ben,

First one will be the best option in this case. As Context.reload() loads only the classes if they are already in the classpath, here we are adding a new jar file(all new classes).

am i correct?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic