Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-8321

Labels and properties caches clearing no longer work

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Trunk
    • Fix Version/s: 16.11.01
    • Component/s: ALL APPLICATIONS
    • Labels:
      None

      Description

      While working on OFBIZ-7798 I noticed an issue with labels cache clearing. It still works correctly in R15.12, I did not test between.

      To test it, load a page with a label, change the label in file, clear all caches in webtools, the new label value should appear, it does not.

        Issue Links

          Activity

          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          Works also in pre-Gradle version

          Show
          jacques.le.roux Jacques Le Roux added a comment - Works also in pre-Gradle version
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          This is related with OFBIZ-7937. A simple solution is to exclude all labels files. I propose this, there should not be any Labels.xml in config dirs which would not be a labels files.

          Index: build.gradle
          ===================================================================
          --- build.gradle	(revision 1763752)
          +++ build.gradle	(working copy)
          @@ -192,6 +192,15 @@
           excludedJavaSources.add 'org/apache/ofbiz/order/thirdparty/taxware/TaxwareServices.java'
           excludedJavaSources.add 'org/apache/ofbiz/order/thirdparty/taxware/TaxwareUTL.java'
          
          +def excludedLabelsFiles = []
          +excludedLabelsFiles.add '*Labels*.xml'
          +excludedLabelsFiles.add 'conditional.xml'
          +excludedLabelsFiles.add 'DefaultMessages.xml'
          +excludedLabelsFiles.add 'EmailPassword.xml'
          +
          +
          +
          +
           sourceSets {
               main {
                   java {
          @@ -203,6 +212,7 @@
                       srcDirs += getDirectoryInActiveComponentsIfExists('config')
                       srcDirs += getDirectoryInActiveComponentsIfExists('dtd')
                       exclude excludedJavaSources
          +            exclude excludedLabelsFiles
                   }
               }
          

          BTW It seems to me it would be better to rename
          conditional.xml to conditionalLabels.xml
          DefaultMessages.xml to DefaultMessagesLabels.xml
          EmailPassword.xml to EmailPasswordLabels.xml
          I'd do so in few days if nobody disagree

          Also Pierre already proposed at OFBIZ-7893 to exclude:
          + exclude ('*.xml')
          + exclude ('*.txt')
          + exclude ('*.jks')
          + exclude ('README')

          I see really no reason to not exclude text and readme files. For *.xml I'd be more cautious, for instance what about axis2.xml and DefaultBarcode.xml? Are they usefull in ofbiz.jar? It seems not to me but would be better to check, and not only those.

          For *.jks I guess it's ok to exclude, I'll anyway check this when I'll implement OFBIZ-7928 which should be hopefully soon.

          I like to be able to dynamically changes properties by clearing their cache. So I'd also exclude them, but we need to check if nothing would break. For instance the properties files in framework/start/src/main/java/org/apache/ofbiz/base/start should not be excluded I guess. For the others I see no reasons to not exclude.

          I'm also curious about why
          srcDirs += getDirectoryInActiveComponentsIfExists('dtd')
          was added in http://svn.apache.org/viewvc?view=revision&revision=1761440.
          I guess for a good reason, and anyway it's not a big deal (apart bloating ofbiz.jar) since I see no reasons to dynamically changes these files while running OFBiz, so more curious than anything else here.

          Show
          jacques.le.roux Jacques Le Roux added a comment - This is related with OFBIZ-7937 . A simple solution is to exclude all labels files. I propose this, there should not be any Labels .xml in config dirs which would not be a labels files. Index: build.gradle =================================================================== --- build.gradle (revision 1763752) +++ build.gradle (working copy) @@ -192,6 +192,15 @@ excludedJavaSources.add 'org/apache/ofbiz/order/thirdparty/taxware/TaxwareServices.java' excludedJavaSources.add 'org/apache/ofbiz/order/thirdparty/taxware/TaxwareUTL.java' +def excludedLabelsFiles = [] +excludedLabelsFiles.add '*Labels*.xml' +excludedLabelsFiles.add 'conditional.xml' +excludedLabelsFiles.add 'DefaultMessages.xml' +excludedLabelsFiles.add 'EmailPassword.xml' + + + + sourceSets { main { java { @@ -203,6 +212,7 @@ srcDirs += getDirectoryInActiveComponentsIfExists('config') srcDirs += getDirectoryInActiveComponentsIfExists('dtd') exclude excludedJavaSources + exclude excludedLabelsFiles } } BTW It seems to me it would be better to rename conditional.xml to conditionalLabels.xml DefaultMessages.xml to DefaultMessagesLabels.xml EmailPassword.xml to EmailPasswordLabels.xml I'd do so in few days if nobody disagree Also Pierre already proposed at OFBIZ-7893 to exclude: + exclude ('*.xml') + exclude ('*.txt') + exclude ('*.jks') + exclude ('README') I see really no reason to not exclude text and readme files. For *.xml I'd be more cautious, for instance what about axis2.xml and DefaultBarcode.xml? Are they usefull in ofbiz.jar? It seems not to me but would be better to check, and not only those. For *.jks I guess it's ok to exclude, I'll anyway check this when I'll implement OFBIZ-7928 which should be hopefully soon. I like to be able to dynamically changes properties by clearing their cache. So I'd also exclude them, but we need to check if nothing would break. For instance the properties files in framework/start/src/main/java/org/apache/ofbiz/base/start should not be excluded I guess. For the others I see no reasons to not exclude. I'm also curious about why srcDirs += getDirectoryInActiveComponentsIfExists('dtd') was added in http://svn.apache.org/viewvc?view=revision&revision=1761440 . I guess for a good reason, and anyway it's not a big deal (apart bloating ofbiz.jar) since I see no reasons to dynamically changes these files while running OFBiz, so more curious than anything else here.
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          Fixed at revision: 1764280

          This fixes both labels and propertie caches clearing issues and while at it also fixes OFBIZ-7937

          Apart a bunch of files and directories present in config directories which should not have been included in ofbiz.jar, I removed all properties files but some, and the entityengine config xml file. THey are needed for unit tests run by Gradle and integration tests. The list of these not excluded files may need to be augmented when new unit tests will be added...

          I also removed the DTDs from the resources, they are useless there.

          Show
          jacques.le.roux Jacques Le Roux added a comment - Fixed at revision: 1764280 This fixes both labels and propertie caches clearing issues and while at it also fixes OFBIZ-7937 Apart a bunch of files and directories present in config directories which should not have been included in ofbiz.jar, I removed all properties files but some, and the entityengine config xml file. THey are needed for unit tests run by Gradle and integration tests. The list of these not excluded files may need to be augmented when new unit tests will be added... I also removed the DTDs from the resources, they are useless there.

            People

            • Assignee:
              jacques.le.roux Jacques Le Roux
              Reporter:
              jacques.le.roux Jacques Le Roux
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development