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

GitInfo.ftl cannot be created when sources checkout using svn

    Details

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

      Description

      When running a hot-deploy component and exception occurs. I have included the component for reference purposes.

      Used the following steps to create the component...
      -ran $ gradlew createComponent -PcomponentName=mycomponent -PcomponentResourceName=myrscname -PwebappName=mywebapp -PbasePermission=NONE
      -added request and associated screen.
      -ran $ gradlew cleanAll loadDefault
      -ran $ gradlew ofbiz

      The console shows the following exception...

      FreeMarker template error: Template inclusion failed (for parameter value "ofbizhome://runtime/SvnInfo.ftl"): /home/wt/wt-mystuff/eclipse/workspace/ofbiz-trunk-test/runtime/SvnInfo.ftl (No such file or directory) ---- FTL stack trace ("~" means nesting-related): - Failed at: #include "ofbizhome://runtime/SvnInfo... [in template "component://tomahawk/template/Footer.ftl" at line 26, column 104] ---- Java stack trace (for programmers): ---- freemarker.core._MiscTemplateException: [... Exception message was already printed; see it above ...] at freemarker.core.Include.accept(Include.java:164) at freemarker.core.Environment.visit(Environment.java:326) at freemarker.core.Environment.visit(Environment.java:332) at freemarker.core.Environment.process(Environment.java:305) at org.apache.ofbiz.base.util.template.FreeMarkerWorker.renderTemplate(FreeMarkerWorker.java:261) at org.apache.ofbiz.widget.model.HtmlWidget.renderHtmlTemplate(HtmlWidget.java:167) at org.apache.ofbiz.widget.model.HtmlWidget$HtmlTemplate.renderWidgetString(HtmlWidget.java:216) at org.apache.ofbiz.widget.model.HtmlWidget.renderWidgetString(HtmlWidget.java:140) at org.apache.ofbiz.widget.model.ModelScreenWidget$PlatformSpecific.renderWidgetString(ModelScreenWidget.java:1321) at org.apache.ofbiz.widget.model.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:98) at org.apache.ofbiz.widget.model.ModelScreenWidget$Section.renderWidgetString(ModelScreenWidget.java:280) at org.apache.ofbiz.widget.model.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:98) at org.apache.ofbiz.widget.model.ModelScreenWidget$Section.renderWidgetString(ModelScreenWidget.java:280) at org.apache.ofbiz.widget.model.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:98) at org.apache.ofbiz.widget.model.ModelScreenWidget$Section.renderWidgetString(ModelScreenWidget.java:280) at org.apache.ofbiz.widget.model.ModelScreen.renderScreenString(ModelScreen.java:164) at org.apache.ofbiz.widget.model.ScreenFactory.renderReferencedScreen(ScreenFactory.java:214) at org.apache.ofbiz.widget.model.ModelScreenWidget$IncludeScreen.renderWidgetString(ModelScreenWidget.java:780) at org.apache.ofbiz.widget.model.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:98) at 
      

        Issue Links

          Activity

          Hide
          wt Wai added a comment -

          the hot-deploy component to help create the issue.

          Show
          wt Wai added a comment - the hot-deploy component to help create the issue.
          Hide
          deepak.dixit Deepak Dixit added a comment -

          Hi Wai,

          Its not related to hot-deploy component. Its related to missing SvnInfo.ftl. If you run following command then it will work fine:

          ./gradlew svnInfoFooter

          Show
          deepak.dixit Deepak Dixit added a comment - Hi Wai, Its not related to hot-deploy component. Its related to missing SvnInfo.ftl. If you run following command then it will work fine: ./gradlew svnInfoFooter
          Hide
          wt Wai added a comment -

          Thanks for the command. Having used the command you provided, ofbiz is complaining about another issue...
          Branch: http://svn.apache.org/repos/asf/ofbiz/trunk Revision: [1755113] Built on: 2016-08-05 05:29:43 Java Version: 1.8.0_92 (Oracle Corporation 25.92-b14) FreeMarker template error: Template inclusion failed (for parameter value "ofbizhome://runtime/GitInfo.ftl"): /home/wt/wt-mystuff/eclipse/workspace/ofbiz-trunk-test/runtime/GitInfo.ftl (No such file or directory)

          I ran $./gradlew gitInfoFooter with the following console error. Note, I did not checkout the ofbiz source using git.
          $ gradlew gitInfoFooter
          :gitInfoFooter
          fatal: Not a git repository (or any parent up to mount point /home/wt)
          Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
          :gitInfoFooter FAILED

          FAILURE: Build failed with an exception.

          • Where:
            Build file '/home/wt/wt-mystuff/eclipse/workspace/ofbiz-trunk-test/build.gradle' line: 665
          • What went wrong:
            Execution failed for task ':gitInfoFooter'.
            > Process 'command 'git'' finished with non-zero exit value 128
          • Try:
            Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

          BUILD FAILED

          Total time: 6.878 secs

          Show
          wt Wai added a comment - Thanks for the command. Having used the command you provided, ofbiz is complaining about another issue... Branch: http://svn.apache.org/repos/asf/ofbiz/trunk Revision: [1755113] Built on: 2016-08-05 05:29:43 Java Version: 1.8.0_92 (Oracle Corporation 25.92-b14) FreeMarker template error: Template inclusion failed (for parameter value "ofbizhome://runtime/GitInfo.ftl"): /home/wt/wt-mystuff/eclipse/workspace/ofbiz-trunk-test/runtime/GitInfo.ftl (No such file or directory) I ran $./gradlew gitInfoFooter with the following console error. Note, I did not checkout the ofbiz source using git. $ gradlew gitInfoFooter :gitInfoFooter fatal: Not a git repository (or any parent up to mount point /home/wt) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set). :gitInfoFooter FAILED FAILURE: Build failed with an exception. Where: Build file '/home/wt/wt-mystuff/eclipse/workspace/ofbiz-trunk-test/build.gradle' line: 665 What went wrong: Execution failed for task ':gitInfoFooter'. > Process 'command 'git'' finished with non-zero exit value 128 Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED Total time: 6.878 secs
          Hide
          deepak.dixit Deepak Dixit added a comment -

          We can use ignore_missing attribute of <#include directive. I tried this but its not working.
          http://freemarker.org/docs/ref_directive_include.html

          Show
          deepak.dixit Deepak Dixit added a comment - We can use ignore_missing attribute of <#include directive. I tried this but its not working. http://freemarker.org/docs/ref_directive_include.html
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          Wai,

          To clarify, can you explain your complete version control configuration? Thanks!

          Show
          jacques.le.roux Jacques Le Roux added a comment - Wai, To clarify, can you explain your complete version control configuration? Thanks!
          Hide
          wt Wai added a comment -

          The source code was checked out using subversion
          $ svn co http://svn.apache.org/repos/asf/ofbiz/trunk ofbiz
          $ gradlew cleanAll build eclipse
          $ gradlew svnInfoFooter
          $ gradlew gitInfoFooter

          -console output...
          :gitInfoFooter
          fatal: Not a git repository (or any parent up to mount point /home/wt)
          Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
          :gitInfoFooter FAILED

          FAILURE: Build failed with an exception.
          ...

          It seems ofbiz/themes/*/template/Footer.ftl contains hardcoded references to both SvnInfo.ftl and GitInfo.ftl. Hence if GitInfo.ftl cannot be generated, then a freemarker exception message is shown at the footer of the page when ofbiz displays any page.

          I have since disabled the <#include ... GitInfo.ftl> in the footer.ftl to prevent this issue.

          Show
          wt Wai added a comment - The source code was checked out using subversion $ svn co http://svn.apache.org/repos/asf/ofbiz/trunk ofbiz $ gradlew cleanAll build eclipse $ gradlew svnInfoFooter $ gradlew gitInfoFooter -console output... :gitInfoFooter fatal: Not a git repository (or any parent up to mount point /home/wt) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set). :gitInfoFooter FAILED FAILURE: Build failed with an exception. ... It seems ofbiz/themes/*/template/Footer.ftl contains hardcoded references to both SvnInfo.ftl and GitInfo.ftl. Hence if GitInfo.ftl cannot be generated, then a freemarker exception message is shown at the footer of the page when ofbiz displays any page. I have since disabled the <#include ... GitInfo.ftl> in the footer.ftl to prevent this issue.
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          Wait Wai, but why running "gradlew gitInfoFooter" if you already run " gradlew svnInfoFooter". They should render the same information (at least that's what the Ant targets did) so I see no point running the 2nd.

          This said thanks for your report, I'm the culprit, I introduced it with http://svn.apache.org/viewvc?view=revision&revision=1597615 I'll see how we can handle this edge case.

          Show
          jacques.le.roux Jacques Le Roux added a comment - Wait Wai, but why running "gradlew gitInfoFooter" if you already run " gradlew svnInfoFooter". They should render the same information (at least that's what the Ant targets did) so I see no point running the 2nd. This said thanks for your report, I'm the culprit, I introduced it with http://svn.apache.org/viewvc?view=revision&revision=1597615 I'll see how we can handle this edge case.
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          Simply check if the one of the 2 major versions managers used with OFBiz (Git or Subversion) is used

          Show
          jacques.le.roux Jacques Le Roux added a comment - Simply check if the one of the 2 major versions managers used with OFBiz (Git or Subversion) is used
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          This is like OFBIZ-8250 where a temporary solution is proposed. We need to report to Apache Freemarker (incubating) because as mentionned Deepak below the ignore_missing attribute of the <#include directive does not work. When it will work we will use it and remove the need of creating empty files when running the build task.

          Show
          jacques.le.roux Jacques Le Roux added a comment - This is like OFBIZ-8250 where a temporary solution is proposed. We need to report to Apache Freemarker (incubating) because as mentionned Deepak below the ignore_missing attribute of the <#include directive does not work. When it will work we will use it and remove the need of creating empty files when running the build task.
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          This was correctly, but temporarily, fixed with OFBIZ-8250

          Show
          jacques.le.roux Jacques Le Roux added a comment - This was correctly, but temporarily, fixed with OFBIZ-8250

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development