Total Pageviews

Search This Blog

Saturday, January 28, 2012

Troubleshooting Batch Client error ClrObject static method invocation error System.Reflection.TargetInvocationException Exception has been thrown by the target of an invocation

Recently, we shifted our Dynamics AX 4.0 Batch Clients from a Server box to Windows 7 Client. After the move, all other batches were running successfully except this batch which has some custom code to do FTP transmission and then move the files to a different directory

Error:

The batch Client was showing this error “ClrObject static method invocation error” and the inner exception revealed the below detailed error

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.IOException: The process cannot access the file because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.__Error.WinIOError()
at System.IO.File.Move(String sourceFileName, String destFileName)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Refle! ction.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at ClrBridgeImpl.InvokeClrStaticMethod(ClrBridgeImpl* , Char* pszClassName, Char* pszMethodName, Char* assemblyName, Int32 argsLength, ObjectWrapper** arguments, Boolean* isException)
 

Troubleshooting Steps:
Tried Restarting Batch Client box and AOS Service but without any luck.


Solution:
As the issue was with the FTP batch job and all other batches were working fine, we tried introducing sleep method with 10 secs of delay before the file move process kicked in. Still didn’t work, increased the delay interval for a further of 60 secs and now the batch started working again.

1 comment:

markjacktechnicalsupport said...

Thank you so much for pointing us in the right direction. Very much appreciated.
MS Office 2010
microsoft windows 7ar
windows firewall support