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

Using non-root Portal Context causes incorrect web resource urls

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: No Longer Reproducible
    • Affects Version/s: 7.0.0 CE GA1
    • Fix Version/s: 7.0.1 CE GA2
    • Component/s: Core Infrastructure
    • Labels:
      None

      Description

      If we switch liferay portal 7.0.0GA1 tomcat-8.0.32 bundle from default context (/ - ROOT) to any other non-root context, for example xyz, portal generates incorrect web resource URLs and displays incorrectly because URLs are broken. To replicate:

      1) Download and install Liferay CE 7.0.0GA1 CE Tomcat bundle.
      2) Move webapps ROOT/ to any other folder i.e: xyz/
      3) Rename tomcat-8.0.32/conf/Catalina/localhost/ROOT.xml tomcat-8.0.32/conf/Catalina/localhost/xyz.xml.
      4) Change context path to: <Context path="/xyz" crossContext="true">
      5) Restart and visit http://localhost:8080/xyz

      If you observe the client/server logs you will see many 404 errors. such as:

      127.0.0.1 - - [16/May/2016:16:23:08 +0000] "GET /xyz/ HTTP/1.1" 200 6379
      127.0.0.1 - - [16/May/2016:16:23:09 +0000] "GET /xyz/xyz/o/frontend-js-web/everything.jsp?browserId=other&themeId=gywebtheme_WAR_gywebtheme&colorSchemeId=01&minifierType=js&minifierBundleId=javascript.everything.files&languageId=en_US&b=7000&t=1463231494182 HTTP/1.1" 404 694

      The problem is the portal context "/xyz" is repeated twice in the broken URLS. When I debugged with sources I found this line that concats the contextPath twice..

      public class PortalWebResourcesUtil {

      public static String getContextPath(String resourceType) {
      String contextPath = PortalUtil.getPathContext();

      return* contextPath.concat(getModuleContextPath(resourceType));*
      }

        Attachments

          Activity

            People

            Assignee:
            brian.lee Brian Lee
            Reporter:
            naci@eteration.com Naci Dai
            Participants of an Issue:
            Recent user:
            Esther Sanz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              5 years, 21 weeks, 2 days ago

                Packages

                Version Package
                7.0.1 CE GA2