web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Facing error in batch job

(0) ShareShare
ReportReport
Posted on by

Hi All,

I am facing error in the batch job which ended in error every time when I try to run it. (see screenshot)

I have tried creating new batch job with the different batch group, run full CIL, compilation e.t.c but the same issue.

This process run without any error if we run it without batch.

Can anyone tell what is the issue?

error-in-batch-job.png

Regards,

Hassan

*This post is locked for comments

  • Suggested answer
    Chaitanya Golla Profile Picture
    on at
    RE: Facing error in batch job

    Hi,

    Can you provide some more information (like the complete stack trace, standard Ax/custom business process) and to capture the exact error you could introduce CLRError exception handling in your code(if its not present) like below.

    System.Exception ex;

    catch (Exception::CLRError)

       {

           ex = ClrInterop::getLastException();

           if (ex != null)

           {

               ex = ex.get_InnerException();

               if (ex != null)

               {

                   error(strFmt("%1",  ex.ToString()));

               }

           }

       }

    Thanks,

    Chaitanya Golla

  • Hassan_rulz Profile Picture
    on at
    RE: Facing error in batch job

    System.NullReferenceException: Object reference not set to an instance of an object.

      at Dynamics.Ax.Application.EgxProcessAllocationService.Run(EgxProcessAllocationServiceContract _contract) in EgxProcessAllocationService.run.xpp:line 7

      at EgxProcessAllocationService::run(Object , Object[] )

      at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeInstanceCall(Object instance, String MethodName, Object[] parameters)

      at Microsoft.Dynamics.Ax.Xpp.DictClass.Callobject(String _methodName, XppObjectBase _Called, Object[] varArgs)

      at Dynamics.Ax.Application.SysOperationServiceController.Runoperation(Boolean _async) in SysOperationServiceController.runOperation.xpp:line 88

      at Dynamics.Ax.Application.SysOperationServiceController.Run() in SysOperationServiceController.run.xpp:line 27

      at Dynamics.Ax.Application.BatchRun.runJobStaticCode(Int64 batchId) in BatchRun.runJobStaticCode.xpp:line 54

      at Dynamics.Ax.Application.BatchRun.runJobStatic(Int64 batchId) in BatchRun.runJobStatic.xpp:line 13

      at BatchRun::runJobStatic(Object[] )

      at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeStaticCall(Type type, String MethodName, Object[] parameters)

      at BatchIL.taskThreadEntry(Object threadArg)

  • Suggested answer
    Chaitanya Golla Profile Picture
    on at
    RE: Facing error in batch job

    Hi,

    As per call stack you are receiving this error at line# 7 of run method in class EgxProcessAllocationService stating object of a certain class is not instantiated and run method is implemented as static. Probably class referenced on line# 7 has runOnProperty set to client.If so, change it to CalledFrom.

    You can debug though visual studio on batch server(when class is executing in batch mode). Refer following link to debug x++ code through visual studio: community.dynamics.com/.../debug-from-visual-studio-x-code-running-on-the-server-ax-2012

    As its a custom code cannot say the exact reason. If error is not resolved, please post the code will try to solve it.

    Thanks,

    Chaitanya Golla

  • Ajit Profile Picture
    on at
    RE: Facing error in batch job

    there could be some casting issue. Are you talking about custom class here?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans