NullPointerException when trying to send a Commerce Notification

Issue

  • When trying to send a notification using the CommerceNotificationHelper service as below:
    _commerceNotificationHelper.sendNotifications(commerceOrder.getGroupId(),
    commerceOrder.getUserId(),
    RequestReceivedNotificationTypeImpl.KEY,
    commerceOrder);
  • The following exception is thrown:
    java.lang.NullPointerException: null
    at com.liferay.commerce.internal.order.term.contributor.ObjectRecipientCommerceDefinitionTermContributor.getFilledTerm(ObjectRecipientCommerceDefinitionTermContributor.java:99) ~[?:?]
    at com.liferay.commerce.notification.internal.util.CommerceNotificationHelperImpl._formatString(CommerceNotificationHelperImpl.java:173) ~[?:?]
    at com.liferay.commerce.notification.internal.util.CommerceNotificationHelperImpl._sendNotification(CommerceNotificationHelperImpl.java:225) ~[?:?]
    at com.liferay.commerce.notification.internal.util.CommerceNotificationHelperImpl.sendNotifications(CommerceNotificationHelperImpl.java:85) ~[?:?]
  • And the Commerce notification is not created.

Environment

  • Liferay DXP 7.4

Resolution

Additional Information

Este artigo foi útil?
Utilizadores que acharam útil: 0 de 0