3

my project has a messages_tr.properties file outside of any sub-module. It is configured by this xml:

<bean id="messageSource" class="...ExposedResourceBundleMessageSource"> // derived from ReloadableResourceBundleMessageSource
    <property name="basenames">
        <list>
            <value>file://${PROP_PATH}/messages</value>
            ...
        </list>
    </property>
    <property name="cacheSeconds" value="40"/>
    <property name="defaultEncoding" value="UTF-8"/>
    <property name="fallbackToSystemLocale" value="false" />
</bean>

When I run project in debug mode, it works just fine. But, any change to the messages_tr.properties doesn't reflect. Neither editing any key-value pair, nor adding a new one.

I thought it maybe a Intellij Cache problem and tried several combinations of:

  • Invalidate Caches / Restart
  • Close Project, delete all .iml + .idea + target
  • restart computer
  • Rebuild + mvn clean install -DskipTests -P Profile
  • File -> Synchronize
  • VCS -> Refresh File Status
  • try on IE and Chrome Incognito, Chrome ctrl-f5
  • add ?*.properties to Settings -> Compiler -> Resource Patterns

I don't want to create a new property file just for this problem, and also it may not work too. I just run out of ideas.

What may prevent Intellij IDEA to update a property file? How can I resolve this?

EDIT: I have a key-value pair in this messages_tr.properties file like key = abcd and I edit it with editor to key = abcd222. Or I add a new pair key2 = abcd222. In the 1st case, message still comes as abcd and in the 2nd case, I get an error saying there is no key like key2. I mean editing content doesn't work.

PROP_PATH is a folder outside of any project module, here absolute path method is used. PROP_PATH is configured via server.xml in websphere configuration wlp folder. This configuration works, but editing doesn't reflect.

5
  • 1
    What do you mean by "update"? From which directory is your application trying to read the .properties file? In other words, what is PROP_PATH in your snippet?
    – yole
    Mar 5, 2018 at 8:32
  • @yole Thanks for reply. Please see my edit at below of question. BTW, this properties file is outside of the project folder I compile to make .war file.
    – kalahari
    Mar 5, 2018 at 8:57
  • @yole You were right, the path was set externally in VM options. I realized that much later, and forgot even asking this question. I will accept if you give this as an answer. Thank you!
    – kalahari
    Jun 6, 2018 at 12:00
  • Did you manage to solve it, @kalahari? I was about to submit a bug report to Jetbrains for this...
    – Pere
    Mar 22, 2023 at 11:30
  • @Pere, sorry I have no memory about this issue.
    – kalahari
    Mar 23, 2023 at 16:23

0

Your Answer

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

Browse other questions tagged or ask your own question.