IBM WebSphere Commerce - PriceRule related debugging - ResolveOrderItemPriceCmdImpl handleNullPriceException
Couple of months back in my work I was assigned with an issue of Add to cart not working in our toolkit environment. The error logs was like below.
Looking at the error logs I was thinking may be somehow currency is becoming null somewhere in the flow and that is causing this issue. For debugging that I enabled logs for different pricerule related classes.
com.ibm.commerce.price.commands.PriceRuleGetContractUnitPriceCmdImpl
com.ibm.commerce.price.rule.commands.InternalRuleEngineExecutePriceRuleCmdImpl
com.ibm.commerce.price.rule.runtime.engine.PriceRuleEngine
com.ibm.commerce.price.rule.runtime.util.PriceRuleHelper
But after enabling the logs for PriceRuleEngine and PriceRuleHelper I came to know that it is not the currency which is causing the issue but an invalid price rule. Then I verified the price rule configuration from Management center and found that for the price rule defined for this particular store there is no contracts assigned.
Then I followed below knowledge center URL to assign the store contract to the price rule from Commerce Accelerator which resolved the issue.
https://www.ibm.com/support/knowledgecenter/en/SSZLC2_7.0.0/com.ibm.commerce.management-center.doc/tasks/tpictassignb2c.htm
Hope this help someone. Let me know your thoughts through the comment section. Feel free to share this page with your friends and colleagues.
Thanks!
[8/1/17 16:43:34:296 CEST] 0000015c CommerceSrvr A com.ibm.commerce.orderitems.commands.ResolveOrderItemPriceCmdImpl handleNullPriceException CMN1011E: Unable to retrieve the price for catEntry 420472, quantity: 1.0, unit of measure: C62, and currency: null.
[8/1/17 16:43:34:297 CEST] 0000015c ExtendedInfo I CWXFR9010I: Extended information : [URL=http://localhost/webapp/wcs/stores/servlet/AjaxOrderChangeServiceItemAdd] [parameters=calculationUsage=-1,-2,-3,-4,-5,-6,-7 orderId=. quantity=1 catalogId=15451 langId=-1 catEntryId=420472 storeId=11352 ] [userId=-1002]
[8/1/17 16:43:34:298 CEST] 0000015c MessageMappin C com.ibm.commerce.foundation.server.command.soi.MessageMappingCmdImpl createBusinessObjectDocumentResponse(CommandProperty, ControllerCommand) No customized message mapping error or response cmd found for errorCommand: com.ibm.commerce.exception.ECApplicationException: Unable to retrieve the price for catEntry 420472, quantity: 1.0, unit of measure: C62, and currency: null.
[8/1/17 16:43:34:307 CEST] 0000015c BusinessObjec E Unable to retrieve the price for catEntry 420472, quantity: 1.0, unit of measure: C62, and currency: null.
com.ibm.commerce.foundation.internal.common.exception.FoundationApplicationException: Unable to retrieve the price for catEntry 420472, quantity: 1.0, unit of measure: C62, and currency: null.
at com.ibm.commerce.foundation.server.command.soi.MessageMappingCmdImpl.constructFoundationApplicationException(MessageMappingCmdImpl.java:674)
at com.ibm.commerce.foundation.server.command.soi.MessageMappingCmdImpl.invokeCommand(MessageMappingCmdImpl.java:317)
at com.ibm.commerce.order.facade.server.commands.soi.OrderMessageMappingCmdImpl.invokeCommand(OrderMessageMappingCmdImpl.java:338)
at com.ibm.commerce.foundation.server.command.soi.MessageMappingCmdImpl.performAction(MessageMappingCmdImpl.java:176)
at com.ibm.commerce.foundation.server.command.soi.MessageMappingCmdImpl.performExecute(MessageMappingCmdImpl.java:136)
at com.ibm.commerce.foundation.server.command.bod.BusinessObjectCommandTargetImpl.executeCommand(BusinessObjectCommandTargetImpl.java:112)
at com.ibm.ws.cache.command.CommandCache.executeCommand(CommandCache.java:332)
at com.ibm.websphere.command.CacheableCommandImpl.execute(CacheableCommandImpl.java:166)
at com.ibm.commerce.foundation.server.command.bod.BusinessObjectDocumentProcessor.processBusinessObjectDocument(BusinessObjectDocumentProcessor.java:276)
at com.ibm.commerce.order.facade.server.OrderFacadeImpl.changeOrder(OrderFacadeImpl.java:79)
at com.ibm.commerce.order.facade.server.EJSLocalStatelessOrder_a357eec5.changeOrder(EJSLocalStatelessOrder_a357eec5.java:165)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at com.ibm.commerce.foundation.internal.client.services.invocation.impl.LocalEJBInvocationBindingImpl.invoke(LocalEJBInvocationBindingImpl.java:211)
at com.ibm.commerce.foundation.internal.client.services.invocation.InvocationService.invoke(InvocationService.java:113)
at com.ibm.commerce.foundation.client.facade.bod.AbstractBusinessObjectDocumentFacadeClient.internalSendBusinessObjectDocument(AbstractBusinessObjectDocumentFacadeClient.java:813)
at com.ibm.commerce.foundation.client.facade.bod.AbstractBusinessObjectDocumentFacadeClient.sendBusinessObjectDocument(AbstractBusinessObjectDocumentFacadeClient.java:529)
at com.ibm.commerce.order.facade.client.AbstractOrderFacadeClient.changeOrder(AbstractOrderFacadeClient.java:210)
at com.ibm.commerce.order.facade.client.CommonOrderFacadeClient.changeOrder(CommonOrderFacadeClient.java:3496)
at com.ibm.commerce.order.facade.client.CommonOrderFacadeClient.addOrderItem(CommonOrderFacadeClient.java:3010)
at com.ibm.commerce.order.facade.client.CommonOrderFacadeClient.addOrderItem(CommonOrderFacadeClient.java:1340)
at com.ibm.commerce.order.facade.client.OrderFacadeClient.addOrderItem(OrderFacadeClient.java:288)
Looking at the error logs I was thinking may be somehow currency is becoming null somewhere in the flow and that is causing this issue. For debugging that I enabled logs for different pricerule related classes.
com.ibm.commerce.price.commands.PriceRuleGetContractUnitPriceCmdImpl
com.ibm.commerce.price.rule.commands.InternalRuleEngineExecutePriceRuleCmdImpl
com.ibm.commerce.price.rule.runtime.engine.PriceRuleEngine
com.ibm.commerce.price.rule.runtime.util.PriceRuleHelper
But after enabling the logs for PriceRuleEngine and PriceRuleHelper I came to know that it is not the currency which is causing the issue but an invalid price rule. Then I verified the price rule configuration from Management center and found that for the price rule defined for this particular store there is no contracts assigned.
Then I followed below knowledge center URL to assign the store contract to the price rule from Commerce Accelerator which resolved the issue.
https://www.ibm.com/support/knowledgecenter/en/SSZLC2_7.0.0/com.ibm.commerce.management-center.doc/tasks/tpictassignb2c.htm
Hope this help someone. Let me know your thoughts through the comment section. Feel free to share this page with your friends and colleagues.
Thanks!
Comments
Post a Comment