0

Can .properties values be stored statically in compiled classes?

I am updating a value in my .properties file yet the log is still showing the old value from the original .properties file. Is this because the class file has stored the .properties values during compilation? (I do not have the original source so cannot recompile)

3
  • 4
    It seems likely that the .properties file is read at startup. Changing it at runtime will not force a reload of properties. Commented Dec 23, 2010 at 18:05
  • What is the environment? Is it a webapp under apache/tomcat? Did you restart the application server? Maybe the application creates a singleton instance for access to the .properties file Commented Dec 23, 2010 at 18:07
  • 1
    You could decompile to code to see what it does. But its highly unlikely that properties have been compiled into the code. It is possible that the properties file is in the jar file and being read from there instead of the file system. Commented Dec 23, 2010 at 19:42

1 Answer 1

1

Properties are not set statically in compiled class. Most likely you have old properties somewhere in classpath, or, maybe, another property file with the same property. Try to run your application in verbose mode in order to get classpath and search in it for properties files loaded.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.