IBM Support

Receipt complete agent throws NPE (NullPointerException)

Troubleshooting


Problem

Receipt complete agent throws NPE (NullPointerException)

Symptom

When customer runs receipt complete agent, system throws an NPE. The trace shows that the system queried for a shipment before throwing the error. See error stack trace below.
This is in 7.0 SP3.
Error Message
<Errors>
    <Error ErrorCode="java.lang.NullPointerException"

        <Attribute Name="ErrorCode" Value="java.lang.NullPointerException"/>
        <Attribute Name="ErrorDescription" Value="Error description not available"/>
        <Error ErrorCode="java.lang.NullPointerException"

            <Stack>java.lang.NullPointerException
 at com.yantra.omp.customdb.YFS_Receipt_HeaderImpl.getReceiptKeyDataMap(YFS_Receipt_HeaderImpl.java:232)
 at com.yantra.wms.business.rcv.WMSReceivingManagerImpl.getCloseReceiptPreference(WMSReceivingManagerImpl.java:278)
 at com.yantra.omp.agent.YFSCloseReceiptAgent.canCloseReceipt(YFSCloseReceiptAgent.java:197)
 at com.yantra.omp.agent.YFSCloseReceiptAgent.callAPI(YFSCloseReceiptAgent.java:135)
 at com.yantra.omp.agent.YFSCloseReceiptAgent.getDocList(YFSCloseReceiptAgent.java:110)
 at com.yantra.omp.agent.YFSCloseReceiptAgent.getJobsForEnterprise(YFSCloseReceiptAgent.java:90)
 at com.yantra.ycp.agent.server.YCPAbstractEnterpriseAgent.getJobs(YCPAbstractEnterpriseAgent.java:46)
 at com.yantra.ycp.agent.server.YCPAbstractAgent.pushCreatedMessages(YCPAbstractAgent.java:419)
 at com.yantra.ycp.agent.server.YCPAbstractAgent.processMessage(YCPAbstractAgent.java:221)
 at com.yantra.ycp.agent.server.YCPAbstractAgent.run(YCPAbstractAgent.java:117)
 at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:324)
 at com.yantra.interop.services.api.ApiHelper.invoke(ApiHelper.java:272)
 at com.yantra.interop.services.flowcomponents.ApiFlowComponent.execute(ApiFlowComponent.java:151)
 at com.yantra.interop.services.flowcomponents.ApiFlowComponent.send(ApiFlowComponent.java:178)
 at com.yantra.integration.adapter.FlowExecutor.execute(FlowExecutor.java:154)
 at com.yantra.integration.adapter.IntegrationAdapter.onMessage(IntegrationAdapter.java:319)
 at com.yantra.interop.services.jms.JMSContextMediator.processMessage(JMSContextMediator.java:73)
 at com.yantra.interop.services.jms.JMSConsumer.onMessage(JMSConsumer.java:134)
 at com.yantra.interop.services.jms.JMSConsumer.run(JMSConsumer.java:242)
 at java.lang.Thread.run(Thread.java:534)
</Stack>
        </Error>
        <Stack>com.yantra.yfc.util.YFCException
 at com.yantra.ycp.agent.server.YCPAbstractAgent.pushCreatedMessages(YCPAbstractAgent.java:425)
 at com.yantra.ycp.agent.server.YCPAbstractAgent.processMessage(YCPAbstractAgent.java:221)
 at com.yantra.ycp.agent.server.YCPAbstractAgent.run(YCPAbstractAgent.java:117)
 at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:324)
 at com.yantra.interop.services.api.ApiHelper.invoke(ApiHelper.java:272)
 at com.yantra.interop.services.flowcomponents.ApiFlowComponent.execute(ApiFlowComponent.java:151)
 at com.yantra.interop.services.flowcomponents.ApiFlowComponent.send(ApiFlowComponent.java:178)
 at com.yantra.integration.adapter.FlowExecutor.execute(FlowExecutor.java:154)
 at com.yantra.integration.adapter.IntegrationAdapter.onMessage(IntegrationAdapter.java:319)
 at com.yantra.interop.services.jms.JMSContextMediator.processMessage(JMSContextMediator.java:73)
 at com.yantra.interop.services.jms.JMSConsumer.onMessage(JMSConsumer.java:134)
 at com.yantra.interop.services.jms.JMSConsumer.run(JMSConsumer.java:242)
 at java.lang.Thread.run(Thread.java:534)
</Stack>
    </Error>
</Errors>

Resolving The Problem

On further analysis, Support found that the shipment against the receipt for which system tried to close did not exist in the YFS_SHIPMENT table. The system purged the shipment before closing its receipt.
System expects this sequence:
- Close receipt
- Close shipment
- Purge shipment
- Purge receipt
When it comes to this unexpected situation, it throws the NPE, as it could not find the shipment associated with the receipt.
 
On further analysis, Support found that in the inbound shipment pipeline, INCLUDE_IN_RECEIPT connects directly to CLOSE_SHIPMENT. Hence, the CLOSE_SHIPMENT agent picks up the receipt in progress shipments and closes it.
 
In order to solve this issue, the pipeline needs to have a listener (RECEIPT_CLOSURE_LISTENER) to monitor the receipt pipeline and move the shipment status to receipt closed (1600.01) when its corresponding receipt goes to received (1500) status.

[{"Product":{"code":"SS6PEW","label":"IBM Sterling Order Management"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":"Not Applicable","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Historical Number

NFX7807

Product Synonym

[<p><b>]Escalation ID[</b><p>];100633;[<p><b>]Severity[</b><p>];Normal;[<p><b>]Type[</b><p>];NormalFix

Document Information

Modified date:
16 June 2018

UID

swg21554264