Symptom
New stocklevels are not inserted into Commerce via integation API like /odata2webservices/NewStock/Products while existing stocklevels can be updated successfully.
See below error log.
| ERROR [hybrisHTTP6] [CustomODataExceptionAwareErrorCallback] Handling exception class de.hybris.platform.inboundservices.persistence.CannotCreateReferencedItemException: Item referenced by attribute [stockLevels] in [Product] item does not exist in the system. Cannot create referenced item for this attribute because it is not partof or autocreate for the item that it belongs to. ERROR [hybrisHTTP6] [CustomODataExceptionAwareErrorCallback] Handling exception class de.hybris.platform.inboundservices.persistence.CannotCreateReferencedItemException: Item referenced by attribute [stockLevels] in [Product] item does not exist in the system. Cannot create referenced item for this attribute because it is not partof or autocreate for the item that it belongs to. DEBUG [hybrisHTTP6] [CustomODataExceptionAwareErrorCallback] Exception details de.hybris.platform.inboundservices.persistence.CannotCreateReferencedItemException: Item referenced by attribute [stockLevels] in [Product] item does not exist in the system. Cannot create referenced item for this attribute because it is not partof or autocreate for the item that it belongs to. at de.hybris.platform.odata2services.odata.persistence.impl.DefaultModelEntityService.lambda$1(DefaultModelEntityService.java:96) ~[classes/:?] at java.util.Optional.orElseThrow(Optional.java:408) ~[?:?] at de.hybris.platform.odata2services.odata.persistence.impl.DefaultModelEntityService.deriveReferencedItemModel(DefaultModelEntityService.java:96) ~[classes/:?] at de.hybris.platform.odata2services.odata.persistence.impl.DefaultModelEntityService.lambda$0(DefaultModelEntityService.java:86) ~[classes/:?] at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) ~[?:?] at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655) ~[?:?] at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) ~[?:?] at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[?:?] at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) ~[?:?] at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?] at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) ~[?:?] at de.hybris.platform.odata2services.odata.persistence.impl.DefaultModelEntityService.deriveItemsReferencedInAttributeValue(DefaultModelEntityService.java:87) ~[classes/:?] at de.hybris.platform.odata2services.odata.persistence.populator.ItemModelCollectionAttributePopulator.getNewCollection(ItemModelCollectionAttributePopulator.java:29) ~[classes/:?] at de.hybris.platform.inboundservices.persistence.populator.AbstractCollectionAttributePopulator.populateAttribute(AbstractCollectionAttributePopulator.java:33) ~[classes/:?] at de.hybris.platform.inboundservices.persistence.populator.AbstractAttributePopulator.handlePopulateAttribute(AbstractAttributePopulator.java:77) ~[classes/:?] at de.hybris.platform.inboundservices.persistence.populator.AbstractAttributePopulator.lambda$2(AbstractAttributePopulator.java:61) ~[classes/:?] |
Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.
Read more...
Environment
- SAP Commerce Cloud
- SAP Commerce
Product
SAP Commerce Cloud all versions ; SAP Commerce all versions
Keywords
KBA , CEC-SCC-INT-IAPI , Integration APIs , Problem
About this page
This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).Search for additional results
Visit SAP Support Portal's SAP Notes and KBA Search.
SAP Knowledge Base Article - Preview