Batch job issue


I have developed a new class in AX 2012 R3 that extends Run Base Batch and I having an issue when I try to run the code as a batch job:

The function DimensionAttributeValueSetStorage.add Item Values was called incorrectly.

Microsoft.Dynamics.Ax.Xpp.ErrorException: Exception of type ‘Microsoft.Dynamics.Ax.Xpp.ErrorException’ was thrown.

at Dynamics.Ax.Application.BRA_AdvanceTransIntegration.Run() in 17

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)

The code works fine if I run it on client. I’ve already tried running both incremental and full CIL, but nothing seems to work, I also tried to deploy this class in another server and it works as batch job with no problems.

It says that method throws an exception at line 17. Please look there and use a debugger if the problem isn’t obvious.