AIF – Object reference not set to an instance of an object

When trying to process any outbound document on the AIF message queue, the document fails when processed through batch jobs with the following error:  Object reference not set to an instance of an object. If it is processed in X++ with the little piece of code below: static void job1(Args _args) {     AifQueueManager document;…

1