• 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

reloading property files after tomcat has started.

 
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks to any one that can fill in my missing knowledge.
What is the proper way to reload altered I18N/L10N property files without restarting the app or app server.

We have a custom class loader that is loading a couple of localization property files that do not live within the tomcat directory structure at server start. It works well. The customer does not like having to restart a server every time they change the property files. They want the app to either update itself or be able to tell the app to reread the property files.


Running tomcat 5.5.28, Struts 2( 2.1.8), xwork-core 2.1.6 (2.1.8 has a reloadable class loader), JSON plugin, and a dash of Spring, and a heavy dose of our own Swiss army knife utilities.


Options I have found so far
1) cannot do it. have to reboot.
2) can only reload property files from the tomcat console/manager app.
3) can do it but have to throw out classloader. (tried it, does not work for me) I have a controller class, it will clear out the property files but does not load up new ones. Even if I logged out and log back in the changes do not appear.


4) write a re-loadable classloader. If I could figure out how to get the class loader from the system the above try block would simply be .


5) Javadoc indicates all that I need to is tell LocalizedTextUtil that it has a new addDefaultResourceBundle() . but no one on the internet says this will work. It did not work for me

6)Have the servlet context get the resource as a stream AGAIAN. But when I do that, all I get is a null pointer error in p.load. I am not getting a file not found, and another app is able to read the property files at the path used here. Why can the server read the file on startup, but not after it is running?
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Java 6 provides the ResourceBundle.Control class which allows you to control the loading and reloading of ResourceBundles. Perhaps that's what you need?
 
peter cooke
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
my customer cannot go above java 5.
that said I ran into the author of our internal classloader. He said I need to look at java's SoftCache and getting it free up its cached content.

Going down that trail.
I found


But then run into the following problems:
  • Having lots of fun trying to get a resource bundle from outside the tomcat home directory. does not look possible -that is what external class loaders are for.
  • how do I determine which SoftCache to clear
  • although I want to clear the cache, there is no clear way to reload it.


  •  
    Roses are red, violets are blue. Some poems rhyme and some don't. And some poems are a tiny ad.
    a bit of art, as a gift, the permaculture playing cards
    https://gardener-gift.com
    reply
      Bookmark Topic Watch Topic
    • New Topic