Issue
- When an Object action is configured to send a notification to a site role, the notification fails to send to the users with that role.
- The following
NoSuchRoleExceptionis thrown in the logs:
2025-05-30 17:16:21.111 ERROR [http-nio-8080-exec-3][ObjectActionEngineImpl:157] No Role exists with the key {companyId=..., name=...}com.liferay.portal.kernel.exception.NoSuchRoleException: No Role exists with the key {companyId=..., name=...}
at com.liferay.portal.service.persistence.impl.RolePersistenceImpl.findByC_N(RolePersistenceImpl.java:5742)
at com.liferay.portal.service.impl.RoleLocalServiceImpl.getRole(RoleLocalServiceImpl.java:906)
at com.liferay.notification.internal.type.users.provider.RoleUsersProvider.provide(RoleUsersProvider.java:69)
at com.liferay.notification.internal.type.UserNotificationType.sendNotification(UserNotificationType.java:120)
at com.liferay.object.internal.action.executor.NotificationTemplateObjectActionExecutorImpl.execute(NotificationTemplateObjectActionExecutorImpl.java:66)
at com.liferay.object.internal.action.engine.ObjectActionEngineImpl.executeObjectActions(ObjectActionEngineImpl.java:152)
Environment
- Liferay DXP 2024.Q4
- Liferay DXP 2025.Q1
Resolution
This issue is caused by the notification template incorrectly saving the site role's External Reference Code (ERC) instead of its name. The notification system fails when it tries to look up the role by its name but is provided an ERC instead.
- This issue is resolved through either:
- Upgrading to 2025.q2.0 or later
- A hotfix to include LPD-51822. Please contact Liferay Support to obtain the fix for your version.
- After applying the hotfix, any existing notification templates configured with site roles must be opened and re-saved. This action corrects the stored data, replacing the ERC with the proper role name, allowing the notifications to be triggered correctly.
Additional Information