Details

      Description

      If you are using the RewriteFilter for making URLs friendlier, the I18nServlet fails

      Steps to reproduce:

      1. Create a web content with the title: my content
      2. Add the Asset publisher to the home page
      3. Click on "my content" title, and the Asset Publisher will display the web content maximized.
      4. Copy the browser URL of the page, it should have a friendly format like: http://localhost:8080/web/guest/home/-/asset_publisher/rlUuyV4yHUXP/content/my-content
      5. Stop the server.
      6. Modify the file (in a real project this will be done with a plugin-ext): TOMCAT_HOME/webapps/ROOT/WEB-INF/urlrewrite.xml and add the next rule adapting the to param to the token/InstanceId obtained in the friendly URL of the step 4, in my case was rlUuyV4yHUXP but it will be different for your test:
        <rule> 
        <from>^/([a-z]{2})/ap_([a-z0-9\-\,\?\=\&amp;]+)$</from> 
        <to>/$1/web/guest/home/-/asset_publisher/rlUuyV4yHUXP/content/$2</to> 
        </rule> 
      7. Start the server
      8. Go to the next URL:http://localhost:8080/en/ap_my-content

      Expected: you go to the en version of the default home page, and view "my content" maximized in the Asset Publisher
      Result : 404 error - Not found
      Logs:

      2019-02-28 17:48:57.829 WARN  [http-nio-8080-exec-1][PortalImpl:6842] com.liferay.portal.kernel.exception.NoSuchGroupException: No Group exists with the key {companyId=0, friendlyURL=/guest}
      com.liferay.portal.kernel.exception.NoSuchGroupException: No Group exists with the key {companyId=0, friendlyURL=/guest}
      	at com.liferay.portal.service.persistence.impl.GroupPersistenceImpl.findByC_F(GroupPersistenceImpl.java:3538)
      	at com.liferay.portal.service.impl.GroupLocalServiceImpl.getFriendlyURLGroup(GroupLocalServiceImpl.java:1487)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:163)
      	at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:54)
      	at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:58)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:137)
      	at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:169)
      	at com.sun.proxy.$Proxy80.getFriendlyURLGroup(Unknown Source)
      	at com.liferay.portal.kernel.service.GroupLocalServiceUtil.getFriendlyURLGroup(GroupLocalServiceUtil.java:611)
      	at com.liferay.portal.servlet.I18nServlet.getI18nData(I18nServlet.java:181)
      	at com.liferay.portal.servlet.I18nServlet.service(I18nServlet.java:97)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)

        Attachments

          Activity

            People

            • Assignee:
              summer.zhang Summer Zhang
              Reporter:
              jose.jimenez Jose Jimenez
              Participants of an Issue:
              Recent user:
              Clarissa Velazquez
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

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