Null pointer Error while removing Documents


 Product(s):APM Implementation and Performance Management
 Version(s):7.18
 Environment:N/A
 Area:N/A
 Subarea:N/A

Problem Description

Getting below error while removing an outdate work instruction document.



Exception Type: Ivara.PL.Exceptions.PLFatalException
Message: OTFatalException caught at: [?InvokeMethodImpl@MethodInvoker@PL@Ivara@@$$FQE$AAMXPE$AAVMethodInvokerArguments@Data@23@AE$CAPE$AAUIMethodResult@523@@Z,C:\a\1\s\PresentationLayer\PL\MethodInvoker.cpp,493]
Message: ObjectRef::operator -> returned NULL for ( 2626, 315 ) : exception will follow
Stack Trace: at Ivara.PL.Client.RemoteCallExceptionThrower.Throw(RemoteCallExceptionResponse ex)
at Ivara.Client.Methods.MethodDispatcher.<>c__DisplayClass39_0.<InvokeServerMethod>b__0()
at Ivara.PL.Client.WrapRemoteCalls.Wrap(Action serverCall, KillActivityMethod killActivity, ExceptionMethod reconnect, DisplayErrorAndShutdownMethod displayErrorAndShutdown, ExceptionMethod handleUnknown)

Solution

There was bad data related to document. Not sure how the data became bad, but it looks like perhaps this document USED to have attachments, and now it no longer does, but the Parent object of attachments (called Attachment Container) is referenced from the Document but does not exist.

  1. Check for StdProcedures that are in the bad state (referring to AttachmentContainers that no longer exist) – run below script.

select ATTACHMENTCO_OI, STDPROCEDUREANDDOCUMENTSOI, REFERENCENUM, title from fnd.STDPROCEDURES where ATTACHMENTCO_OI is not null and ATTACHMENTCO_OI not in (select ATTACHMENTCONTAINEROI from oq.ATTCONTAINTER);

Example:

  1. Then update ATTACHMENTCO_OI to ‘NULL’ for all StdProcedure in question – example run update query for document 331.

--update fnd.STDPROCEDURES set ATTACHMENTCO_OI = NULL where STDPROCEDUREANDDOCUMENTSOI = 331; --change STDPROCEDUREANDDOCUMENTSOI = ?

 

Note: Apply change in QA/Test environment and test the result, if there are no issue and you are satisfied with the result and ready to promote to Production. ONLY THEN, promote from QA/Test to PROD.

See also

This issue has been fixed in APM version 7.23
Bug reference -1226109