-
Type:
Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: 7.0.X, 7.1.X, Master
-
Fix Version/s: 7.0.0 DXP FP77, 7.0.10.11 DXP SP11, 7.0.X, 7.1.10 DXP FP10, 7.1.10.2 SP2, 7.1.3 CE GA4, 7.1.X, Master
-
Component/s: Core Infrastructure
-
Branch Version/s:7.1.x, 7.0.x
-
Backported to Branch:Committed
-
Story Points:0.25
-
Fix Priority:3
-
Git Pull Request:
If you are using the RewriteFilter for making URLs friendlier, the I18nServlet fails
Steps to reproduce:
- Create a web content with the title: my content
- Add the Asset publisher to the home page
- Click on "my content" title, and the Asset Publisher will display the web content maximized.
- 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
- Stop the server.
- 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\-\,\?\=\&]+)$</from> <to>/$1/web/guest/home/-/asset_publisher/rlUuyV4yHUXP/content/$2</to> </rule>
- Start the server
- 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)