This discussion is archived
2 Replies Latest reply: Sep 10, 2012 8:54 AM by 960742 RSS

Java App cannot read prefs.xml after startup

960742 Newbie
Currently Being Moderated
Hi,

We have a java application that uses Java Preferences to access application properties/configuration. Some of the application properties can be modified during application runtime and hence the application re-reads the preferences file(prefs.xml) at regular intervals. All was well till recently- the application reads the prefs.xml correctly on start-up but if the property value changes during application runtime(i.e. the prefs.xml is updated), it does not seem to get the latest value of that property. This seems to happen for 1 userid only and on certain servers. It works if the application is run with a different userid on the same servers.

Has anyone encountered similar issues and know of the potential cause ? Both the users have the same setup - no issue with permissions etc.

Appreciate your input.
  • 1. Re: Java App cannot read prefs.xml after startup
    903917 Newbie
    Currently Being Moderated
    For the 1 userid that this is happening on, if you restart the application for them, are they then able to see the updated preferences?
  • 2. Re: Java App cannot read prefs.xml after startup
    960742 Newbie
    Currently Being Moderated
    Thanks for responding.
    Yes, if the application is restarted, it reads the changes made to prefs.xml. Basically it appears the app reads the prefs.xml on startup correclty. Once the application is running, it uses the original value even though the value is changed in prefs.xml.
    I do invoke the preferences.sync() before accessing the value.

    This issue happens in our production environments for the application user id only. The SA could not indicate if there were any patches etc installed that might be causing this issue .. if i could get some guidance on the possible cause of this issue, it will be helpful.

    Thanks a lot!

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points