Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
OrderValidator and CustomOrderValidator error
Good morning to everyone. I'm following this example https://learn.liferay.com/commerce/latest/en/developer-guide/sales/implementing-a-custom-order-validator.html in
order to implement a custom order validator. I noticed that when a new
CommerceOrderValidatorResult(TRUE) is returned everything works good,
but when a new CommerceOrderValidatorResult(FALSE) is returned then
the custom error message doesn't show up and I get this ERROR
[http-nio-8080-exec-9][ExceptionMapper:68] null
com.liferay.commerce.exception.CommerceOrderValidatorException:
null.
at
com.liferay.commerce.service.impl.CommerceOrderItemLocalServiceImpl.validate(CommerceOrderItemLocalServiceImpl.java:1164)
~[?:?]
at
com.liferay.commerce.service.impl.CommerceOrderItemLocalServiceImpl._createCommerceOrderItem(CommerceOrderItemLocalServiceImpl.java:1194)
~[?:?]
at
com.liferay.commerce.service.impl.CommerceOrderItemLocalServiceImpl.addCommerceOrderItem(CommerceOrderItemLocalServiceImpl.java:134)
~[?:?]
....
....
This error happens also with the default CommerceOrderValidator, for example on a fresh installation when you try to add to cart a product and you don't have enough quantity.
Liferay Community Edition Portal 7.4.3.18
Actually it came up that was a bug!
After my post an issue has been opened (https://issues.liferay.com/browse/COMMERCE-9060). So I guess the problem will be fixed in next release.