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

remove ofbizSecure and ofbizBackgroundSecure targets from the gradle build script

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 16.11.01
    • Fix Version/s: 16.11.01
    • Component/s: None
    • Labels:
      None

      Description

      The tasks ofbizSecure and ofbizBackgroundSecure utilize the notsoserial API in the JVM arguments. However, given that this has no effect on system performance, we should make all tasks secure by default (ofbiz, ofbizDebug, ofbizBackground) and remove the secure tasks. This has the benefit of reducing the number of tasks users need to be aware of.

        Activity

        Hide
        taher Taher Alkhateeb added a comment -

        Done and committed in r1756305.

        Show
        taher Taher Alkhateeb added a comment - Done and committed in r1756305.
        Hide
        taher Taher Alkhateeb added a comment -

        Work is complete and all tests pass

        Show
        taher Taher Alkhateeb added a comment - Work is complete and all tests pass
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        I thought a minute about hidding deserialize-trace.txt and is-deserialized.txt from svn (using svn:ignore). But it's maybe better to have them show to users. Because this is a sensible thing and those could be good reminders about it. Windows committers (apart me who now ) can always use ToirtoiseSVN ignore-on-commit feature; others have to wait SVN-2858. BTW this also to encourage committers to vote for this issue

        Show
        jacques.le.roux Jacques Le Roux added a comment - I thought a minute about hidding deserialize-trace.txt and is-deserialized.txt from svn (using svn:ignore). But it's maybe better to have them show to users. Because this is a sensible thing and those could be good reminders about it. Windows committers (apart me who now ) can always use ToirtoiseSVN ignore-on-commit feature; others have to wait SVN-2858 . BTW this also to encourage committers to vote for this issue
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        We have a problem, on Windows at least:

        C:\projectASF-Mars\ofbiz>gradlew --stacktrace ofbizBackground
        Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
        
        FAILURE: Build failed with an exception.
        
        * Where:
        Build file 'C:\projectASF-Mars\ofbiz\build.gradle' line: 761
        
        * What went wrong:
        Could not find property 'os' on root project 'ofbiz'.
        
        * Try:
        Run with --info or --debug option to get more log output.
        
        * Exception is:
        groovy.lang.MissingPropertyException: Could not find property 'os' on root project 'ofbiz'.
                at org.gradle.api.internal.AbstractDynamicObject.propertyMissingException(AbstractDynamicObject.java:43)
                at org.gradle.api.internal.AbstractDynamicObject.getProperty(AbstractDynamicObject.java:35)
                at org.gradle.api.internal.CompositeDynamicObject.getProperty(CompositeDynamicObject.java:97)
                at org.gradle.groovy.scripts.BasicScript.propertyMissing(BasicScript.java:66)
                at org.gradle.groovy.scripts.Script.getProperty(Script.java:56)
                at build_146dpgoos7lwgtdjesm7a07a.createOfbizBackgroundCommandTask(C:\projectASF-Mars\ofbiz\build.gradle:761)
                at build_146dpgoos7lwgtdjesm7a07a$_run_closure35.doCall(C:\projectASF-Mars\ofbiz\build.gradle:734)
        
        Show
        jacques.le.roux Jacques Le Roux added a comment - We have a problem, on Windows at least: C:\projectASF-Mars\ofbiz>gradlew --stacktrace ofbizBackground Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 FAILURE: Build failed with an exception. * Where: Build file 'C:\projectASF-Mars\ofbiz\build.gradle' line: 761 * What went wrong: Could not find property 'os' on root project 'ofbiz'. * Try: Run with --info or --debug option to get more log output. * Exception is: groovy.lang.MissingPropertyException: Could not find property 'os' on root project 'ofbiz'. at org.gradle.api.internal.AbstractDynamicObject.propertyMissingException(AbstractDynamicObject.java:43) at org.gradle.api.internal.AbstractDynamicObject.getProperty(AbstractDynamicObject.java:35) at org.gradle.api.internal.CompositeDynamicObject.getProperty(CompositeDynamicObject.java:97) at org.gradle.groovy.scripts.BasicScript.propertyMissing(BasicScript.java:66) at org.gradle.groovy.scripts.Script.getProperty(Script.java:56) at build_146dpgoos7lwgtdjesm7a07a.createOfbizBackgroundCommandTask(C:\projectASF-Mars\ofbiz\build.gradle:761) at build_146dpgoos7lwgtdjesm7a07a$_run_closure35.doCall(C:\projectASF-Mars\ofbiz\build.gradle:734)
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        Same on linux

        ofbizDemo@ofbiz-vm:~/trunk$ ./gradlew  --stacktrace "ofbizBackground --start"
        
        FAILURE: Build failed with an exception.
        
        * Where:
        Build file '/home/ofbizDemo/trunk/build.gradle' line: 761
        
        * What went wrong:
        Could not find property 'os' on root project 'ofbiz'.
        
        * Try:
        Run with --info or --debug option to get more log output.
        
        * Exception is:
        groovy.lang.MissingPropertyException: Could not find property 'os' on root project 'ofbiz'.
                at org.gradle.api.internal.AbstractDynamicObject.propertyMissingException(AbstractDynamicObject.java:43)
                at org.gradle.api.internal.AbstractDynamicObject.getProperty(AbstractDynamicObject.java:35)
                at org.gradle.api.internal.CompositeDynamicObject.getProperty(CompositeDynamicObject.java:97)
                at org.gradle.groovy.scripts.BasicScript.propertyMissing(BasicScript.java:66)
                at org.gradle.groovy.scripts.Script.getProperty(Script.java:56)
                at build_g9a0vr11pt3xrbvhhnl5xaag.createOfbizBackgroundCommandTask(/home/ofbizDemo/trunk/build.gradle:761)
                at build_g9a0vr11pt3xrbvhhnl5xaag$_run_closure35.doCall(/home/ofbizDemo/trunk/build.gradle:734)
        
        Show
        jacques.le.roux Jacques Le Roux added a comment - Same on linux ofbizDemo@ofbiz-vm:~/trunk$ ./gradlew --stacktrace "ofbizBackground --start" FAILURE: Build failed with an exception. * Where: Build file '/home/ofbizDemo/trunk/build.gradle' line: 761 * What went wrong: Could not find property 'os' on root project 'ofbiz'. * Try: Run with --info or --debug option to get more log output. * Exception is: groovy.lang.MissingPropertyException: Could not find property 'os' on root project 'ofbiz'. at org.gradle.api.internal.AbstractDynamicObject.propertyMissingException(AbstractDynamicObject.java:43) at org.gradle.api.internal.AbstractDynamicObject.getProperty(AbstractDynamicObject.java:35) at org.gradle.api.internal.CompositeDynamicObject.getProperty(CompositeDynamicObject.java:97) at org.gradle.groovy.scripts.BasicScript.propertyMissing(BasicScript.java:66) at org.gradle.groovy.scripts.Script.getProperty(Script.java:56) at build_g9a0vr11pt3xrbvhhnl5xaag.createOfbizBackgroundCommandTask(/home/ofbizDemo/trunk/build.gradle:761) at build_g9a0vr11pt3xrbvhhnl5xaag$_run_closure35.doCall(/home/ofbizDemo/trunk/build.gradle:734)
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        Bug fixed at r1756351

        Show
        jacques.le.roux Jacques Le Roux added a comment - Bug fixed at r1756351
        Hide
        taher Taher Alkhateeb added a comment -

        Jacques this fix is incorrect, now ofbizBackground is in the foreground and you left functions orphaned in the code!

        I will revert your work and fix this

        Show
        taher Taher Alkhateeb added a comment - Jacques this fix is incorrect, now ofbizBackground is in the foreground and you left functions orphaned in the code! I will revert your work and fix this
        Hide
        taher Taher Alkhateeb added a comment -

        Okay, thank you for reporting this, it is properly fixed in r1756407. The correct solution was to convert the "os" from a variable to a project property. Now the system behaves correctly.

        Be careful with these changes Jacques you just rendered two full (and difficult to write) functions in build.gradle orphaned with nothing calling them. You also made ofbizBackground operate in the foreground, which is just useless, this is no different from saying ./gradlew ofbiz.

        Anyway, some further help with testing is appreciated if you can spare some time. Thank you.

        Show
        taher Taher Alkhateeb added a comment - Okay, thank you for reporting this, it is properly fixed in r1756407. The correct solution was to convert the "os" from a variable to a project property. Now the system behaves correctly. Be careful with these changes Jacques you just rendered two full (and difficult to write) functions in build.gradle orphaned with nothing calling them. You also made ofbizBackground operate in the foreground, which is just useless, this is no different from saying ./gradlew ofbiz. Anyway, some further help with testing is appreciated if you can spare some time. Thank you.
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        Thanks Taher,

        Yes I saw that it was not a correct fix when I used it for the trunk demo, and actually even locally before. I wanted something working for the trunk demo and thought I could fix it later. I did not see the

        two full (and difficult to write) functions in build.gradle orphaned with nothing calling them.

        though

        Show
        jacques.le.roux Jacques Le Roux added a comment - Thanks Taher, Yes I saw that it was not a correct fix when I used it for the trunk demo, and actually even locally before. I wanted something working for the trunk demo and thought I could fix it later. I did not see the two full (and difficult to write) functions in build.gradle orphaned with nothing calling them. though
        Hide
        taher Taher Alkhateeb added a comment -

        Hi Jacques, yeah those are createOfbizBackgroundCommandTask and spawnProcess. These two functions use the java ProcessBuilder API to fork a new process with output redirected to /runtime/logs/console.log and this is how OFBiz is started in the background. In fact, what happens exactly is that Gradle calls Gradle but in a new process.

        Anyway, I tried a few more tests on my computer and I think it is relatively stable now. Thank you again for catching the bug and reporting it, and a few more tests would be great if you can spare some.

        Show
        taher Taher Alkhateeb added a comment - Hi Jacques, yeah those are createOfbizBackgroundCommandTask and spawnProcess. These two functions use the java ProcessBuilder API to fork a new process with output redirected to /runtime/logs/console.log and this is how OFBiz is started in the background. In fact, what happens exactly is that Gradle calls Gradle but in a new process. Anyway, I tried a few more tests on my computer and I think it is relatively stable now. Thank you again for catching the bug and reporting it, and a few more tests would be great if you can spare some.
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        Thanks Taher, I need to review the OFBiz Gradle files in details now, to avoid such errors in the future!

        Show
        jacques.le.roux Jacques Le Roux added a comment - Thanks Taher, I need to review the OFBiz Gradle files in details now, to avoid such errors in the future!

          People

          • Assignee:
            taher Taher Alkhateeb
            Reporter:
            taher Taher Alkhateeb
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development