Issue
- When we open "Site Builder" => "Pages" the following error is thrown and site pages are not displayed:
com.liferay.portal.kernel.exception.NoSuchResourcePermissionException: {companyId=20100, name=com.liferay.translation.en_US, primKey=com.liferay.translation.en_US, scope=4}
at com.liferay.portal.service.impl.ResourcePermissionLocalServiceImpl.hasResourcePermission(ResourcePermissionLocalServiceImpl.java:1080) ~[portal-impl.jar:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:66) ~[portal-kernel.jar:?]
at com.liferay.portal.kernel.service.ResourcePermissionLocalServiceWrapper.hasResourcePermission(ResourcePermissionLocalServiceWrapper.java:800) ~[portal-kernel.jar:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:66) ~[portal-kernel.jar:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:50) ~[portal-impl.jar:?]
at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:69) ~[portal-impl.jar:?]
at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:57) ~[portal-impl.jar:?]
at com.liferay.portal.spring.aop.AopInvocationHandler.invoke(AopInvocationHandler.java:49) ~[portal-impl.jar:?]
at com.liferay.portal.service.impl.ResourceLocalServiceImpl.hasUserPermissions(ResourceLocalServiceImpl.java:408) ~[portal-impl.jar:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:50) ~[portal-impl.jar:?]
at com.liferay.portal.spring.aop.AopInvocationHandler.invoke(AopInvocationHandler.java:49) ~[portal-impl.jar:?]
at com.liferay.portal.kernel.service.ResourceLocalServiceUtil.hasUserPermissions(ResourceLocalServiceUtil.java:345) ~[portal-kernel.jar:?]
at com.liferay.portal.security.permission.AdvancedPermissionChecker.doCheckPermission(AdvancedPermissionChecker.java:421) ~[portal-impl.jar:?]
at com.liferay.portal.security.permission.AdvancedPermissionChecker._hasUserPermissionImpl(AdvancedPermissionChecker.java:1309) ~[portal-impl.jar:?]
at com.liferay.portal.security.permission.AdvancedPermissionChecker._hasPermissionImpl(AdvancedPermissionChecker.java:1278) ~[portal-impl.jar:?]
at com.liferay.portal.security.permission.AdvancedPermissionChecker.hasPermission(AdvancedPermissionChecker.java:243) ~[portal-impl.jar:?]
Environment
- Liferay DXP 7.3
- Liferay DXP 7.4
Resolution
- The root cause of the com.liferay.portal.kernel.exception.NoSuchResourcePermissionException exception is the ResourcePermission table is missing the record linked to the en_US language:
{companyId=20100, name=com.liferay.translation.en_US, primKey=com.liferay.translation.en_US, scope=4}
-
- This en_US language is missing in the portal-ext.properties, but it is used by an instance.
- To solve it, you have two options:
- Option 1: Add en_US language to the portal-ext.properties
- Stop the application server
- Edit the portal-ext.properties
- file adding en_US to the locales and locales.enabled properties, for example:
locales=ca_ES,es_ES,en_US
locales.enabled=ca_ES,es_ES,en_US
- Start the application server: The missing en_US entries of ResourcePermission table will be added during startup time.
-
Option 2: Remove en_US language from the instance configuration
- If you are not going to use the en_US local in your system, you can remove it from the instance configuration
- Go to Control Panel => Instance Settings => Localization
- Remove the "en_US" locale from the "Current" column. These languages must match the portal-ext.properties configuration.
- Save changes.