Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-118500

Liferay unable to load Javascript resources when using a custom root context.

    Details

      Description

      Preconditions:

      1. Change root context from '/' to another value. For example, changing it to 'myportal' in Tomcat would be:

        Change the ROOT folder name (under LIFERAY_HOME/TOMCAT_HOME/webapps/ROOT) to 'myportal'.
        Change the ROOT.xml file name (under LIFERAY_HOME/TOMCAT_HOME/conf/Catalina/localhost/) to 'myportal.xml'.
        Clear temp and work directories under TOMCAT_HOME.

      1. On master: Enable JQuery. Thus, in osgi/configs/ directory create the file:
        com.liferay.frontend.js.jquery.web.internal.configuration.JSJQueryConfiguration.config
        with following content:
        enableJQuery="true"
      1. On 7.2: JQuery is enabled by default.

       

      Steps to reproduce:

       

      Observed behavior:
      Combo servlet URL has an error.
      On master:

      http://localhost:8080/myportal/myportal/combo?browserId=chrome&minifierType=js&languageId=en_US&b=7304&t=1596551662833&/myportal/o/frontend-js-jquery-web/jquery/jquery.min.js&/myportal/o/frontend-js-jquery-web/jquery/init.js&/myportal/o/frontend-js-jquery-web/jquery/ajax.js&/myportal/o/frontend-js-jquery-web/jquery/bootstrap.bundle.min.js&/myportal/o/frontend-js-jquery-web/jquery/collapsible_search.js&/myportal/o/frontend-js-jquery-web/jquery/fm.js&/myportal/o/frontend-js-jquery-web/jquery/form.js&/myportal/o/frontend-js-jquery-web/jquery/popper.min.js&/myportal/o/frontend-js-jquery-web/jquery/side_navigation.js
      

      On 7.2.x:

      http://localhost:8080/myportal/myportal/combo?browserId=other&minifierType=js&languageId=es_ES&b=7210&t=1596526812119&/myportal/o/frontend-js-jquery-web/jquery/jquery.min.js&/myportal/o/frontend-js-jquery-web/jquery/bootstrap.bundle.min.js&/myportal/o/frontend-js-jquery-web/jquery/collapsible_search.js&/myportal/o/frontend-js-jquery-web/jquery/fm.js&/myportal/o/frontend-js-jquery-web/jquery/form.js&/myportal/o/frontend-js-jquery-web/jquery/popper.min.js&/myportal/o/frontend-js-jquery-web/jquery/side_navigation.js
      

      Please, note that context 'myportal' appears twice in the URL. So, a 404 response code is gotten.

      Expected behavior:
      Combo servlet URL is correct.
      On master:

      http://localhost:8080/myportal/combo?browserId=chrome&minifierType=js&languageId=en_US&b=7304&t=1596551662833&/myportal/o/frontend-js-jquery-web/jquery/jquery.min.js&/myportal/o/frontend-js-jquery-web/jquery/init.js&/myportal/o/frontend-js-jquery-web/jquery/ajax.js&/myportal/o/frontend-js-jquery-web/jquery/bootstrap.bundle.min.js&/myportal/o/frontend-js-jquery-web/jquery/collapsible_search.js&/myportal/o/frontend-js-jquery-web/jquery/fm.js&/myportal/o/frontend-js-jquery-web/jquery/form.js&/myportal/o/frontend-js-jquery-web/jquery/popper.min.js&/myportal/o/frontend-js-jquery-web/jquery/side_navigation.js
      

      On 7.2.x:

      http://localhost:8080/myportal/combo?browserId=other&minifierType=js&languageId=es_ES&b=7210&t=1596526812119&/myportal/o/frontend-js-jquery-web/jquery/jquery.min.js&/myportal/o/frontend-js-jquery-web/jquery/bootstrap.bundle.min.js&/myportal/o/frontend-js-jquery-web/jquery/collapsible_search.js&/myportal/o/frontend-js-jquery-web/jquery/fm.js&/myportal/o/frontend-js-jquery-web/jquery/form.js&/myportal/o/frontend-js-jquery-web/jquery/popper.min.js&/myportal/o/frontend-js-jquery-web/jquery/side_navigation.js
      

      Context 'myportal' appears only once in the URL.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                summer.zhang Summer Zhang
                Reporter:
                sergio.alonso Sergio Alonso
                Participants of an Issue:
                Recent user:
                Clarissa Velazquez
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  6 weeks ago

                  Packages

                  Version Package
                  7.2.10 DXP FP8
                  7.2.10.2 DXP SP3
                  7.2.X
                  7.3.4 CE GA5
                  Master