How to resolve Error occurred while processing batch job?

We have created a batch job class, which read the excel file from shared folder and insert that data into Table.

If we run this class without batch processing it works fine but after adding batch processing it occurs an error.

Enabled AOS as batch server also.

Is there any setup we are missing for batch processing.

Any help.

“It occurs an error” isn’t a very detailed description of the behavior you’re observing. You would have to give us more information.

Do you realize that jobs and batches runs on different computers and under different user accounts? Maybe the shared folder isn’t accessible from AOS or the AOS service account doesn’t have permissions to read files from there. Consider running your code interactively on server (instead of in a job on client) to see whether the problem is about the location or something else (such as permissions). Don’t forget that you can use the debugger to see where your code is failing.

Thanks for reply Martin, i have checked the permission of shared folder and it’s fine. also i have changed RunOn Property of class from Client to Server.

Also used the debugger @ run method of class but it can’t trigger. I have run this batch job on application server.

Great, first bug is fixed. You can’t run classes on batch service if they’re set to run on client only.

Check whether debugging is enabled on the AOS (using Dynamics AX Server Configuration Utility).

I have enabled debugging on AOS but still can’t trigger & An error occurred while processing batch job Runbase batch.

Debugger triggered when i run class without batch processing.

Have you also ticked “Enable global breakpoints to debug X++ code running in batch jobs”?


Hello Martin any other setting that i missed out?

If i insert records manually in a table through this batch job class then it’s working fine but if read data from excel file then only it occurs an error.

How to check that AOS service account has permissions to read files from shared folder or not?

I have resolve this using csv file.