OrderValidator and CustomOrderValidator errorOrderValidator and CustomOrderValidator errorhttps://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785333&threadId=1213982092024-03-29T04:46:24Z2024-03-29T04:46:24ZRE: OrderValidator and CustomOrderValidator errorGennaro Lippiellohttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1213986182022-04-12T07:23:08Z2022-04-12T07:22:32Z<p>Actually it came up that was a bug!</p>
<p>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.</p>Gennaro Lippiello2022-04-12T07:22:32ZOrderValidator and CustomOrderValidator errorGennaro Lippiellohttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1213982082022-04-11T11:49:48Z2022-04-11T11:49:48Z<p>Good morning to everyone. I'm following this example <a
href="https://learn.liferay.com/commerce/latest/en/developer-guide/sales/implementing-a-custom-order-validator.html"
target="_blank">https://learn.liferay.com/commerce/latest/en/developer-guide/sales/implementing-a-custom-order-validator.html</a> 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<br />
[http-nio-8080-exec-9][ExceptionMapper:68] null<br />
com.liferay.commerce.exception.CommerceOrderValidatorException:
null.<br /> at
com.liferay.commerce.service.impl.CommerceOrderItemLocalServiceImpl.validate(CommerceOrderItemLocalServiceImpl.java:1164)
~[?:?]<br /> at
com.liferay.commerce.service.impl.CommerceOrderItemLocalServiceImpl._createCommerceOrderItem(CommerceOrderItemLocalServiceImpl.java:1194)
~[?:?]<br /> at
com.liferay.commerce.service.impl.CommerceOrderItemLocalServiceImpl.addCommerceOrderItem(CommerceOrderItemLocalServiceImpl.java:134)
~[?:?]<br /> ....<br /> ....</p>
<p> </p>
<p>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.&l