NAV 2013 NAS File Import Call back Error

NAVPRAKASHNAVPRAKASH Member Posts: 10
edited 2013-11-27 in NAV Three Tier
Dear Experts

I’m trying import txt file using NAS. NAS throws the Call back error while using the standard SlientUpload function. I have tried in RTC Client for importing the file, NAV repeatedly asked confirmation dialog to access the File every time in a new NAV session. I have overcome the confirmation dialog using the “ServicePrincipalNameRequired” = true in the user ClientUserSetting. After this setting it stopped asking confirmation in RTC Client. But It seems the same confirmation is comes in the NAS too. This was reason for error in the NAS Import. I have tried to create SPN for the Domin user. Any special setup is required in Config file for this? Any suggestion is highly appreciated.

The below message for Event Log

The Microsoft Dynamics NAV Application Server session has failed. Reason: Type: Microsoft.Dynamics.Nav.Types.Exceptions.NavNCLCallbackNotAllowedException
SuppressMessage: False
FatalityScope: None
Message: Microsoft Dynamics NAV Application Server attempted to issue a client callback to create a DotNet object: System.IO.File (CodeUnit 419 File Management). Client callbacks are not supported on Microsoft Dynamics NAV Application Server.
StackTrace:
at Microsoft.Dynamics.Nav.Runtime.HeadlessClientCallback.CreateDotNetHandle(String assemblyFullName, String typeName, Guid formHandle, String varName, Boolean createInstance, Object[] arguments)
at Microsoft.Dynamics.Nav.Runtime.NavDotNet.CheckTypeIsLoaded()
at Microsoft.Dynamics.Nav.Runtime.NavDotNet.InvokeStaticMethod[T](String methodName, UInt32 methodIndex, Object[] arguments)
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit419.UploadFileSilent_Scope.OnRun()
at Filter.InvokeWithFilter(NavMethodScope )
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit419.UploadFileSilent(NavText clientFilePath)
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit419.OnInvoke(Int32 memberId, Object[] args)
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit58141.OnRun_Scope.OnRun()
at Filter.InvokeWithFilter(NavMethodScope )
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit58141.OnRun(INavRecordHandle εrec)
at Microsoft.Dynamics.Nav.Runtime.NavCodeunit.DoRun(DataError errorLevel, NavRecord record)
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit59000.OnRun_Scope.OnRun()
at Filter.InvokeWithFilter(NavMethodScope )
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit59000.OnRun(INavRecordHandle εrec)
at Microsoft.Dynamics.Nav.Runtime.NavCodeunit.DoRun(DataError errorLevel, NavRecord record)
at Microsoft.Dynamics.Nav.Runtime.NavCodeunit.InvokeRun(Int32 objectId, Object[] args)
at Microsoft.Dynamics.Nav.Runtime.NavApplicationServer.InternalStartNas(Object config)
Source: Microsoft.Dynamics.Nav.Ncl
HResult: -2146233088

Thanks in advance

Comments

  • diveshboradiveshbora Member Posts: 1
    Hi

    I'm also facing the same issue. Can you please let me know the Navision 2013 Build that you are using?

    Thanks.
  • NAVPRAKASHNAVPRAKASH Member Posts: 10
    I'm using Build 7.00.34216
  • NAVPRAKASHNAVPRAKASH Member Posts: 10
    Does any special Permission is required in the Windows for calling the .Net Variables without Permission Dialog Confirmation or something related to SPN permission ?

    I have created simple CU with two lines of Code

    FileName := 'C:\T1\T.TXT';
    FileName2 := FileMgt.UploadFileSilent(FileName);

    I have executed this CU through NAS

    The File didn't uploaded and below error logged in Event Viewer. I hope many people have already tried File Import in NAS.

    What I'm missing here ?

    Server instance: DynamicsNAV70
    Session type: Nas
    Session ID: 1
    The Microsoft Dynamics NAV Application Server session has failed. Reason: Type: Microsoft.Dynamics.Nav.Types.Exceptions.NavNCLCallbackNotAllowedException
    SuppressMessage: False
    FatalityScope: None
    Message: Microsoft Dynamics NAV Application Server attempted to issue a client callback to create a DotNet object: System.IO.File (CodeUnit 419 File Management). Client callbacks are not supported on Microsoft Dynamics NAV Application Server.
    StackTrace:
    at Microsoft.Dynamics.Nav.Runtime.HeadlessClientCallback.CreateDotNetHandle(String assemblyFullName, String typeName, Guid formHandle, String varName, Boolean createInstance, Object[] arguments)
    at Microsoft.Dynamics.Nav.Runtime.NavDotNet.CheckTypeIsLoaded()
    at Microsoft.Dynamics.Nav.Runtime.NavDotNet.InvokeStaticMethod[T](String methodName, UInt32 methodIndex, Object[] arguments)
    at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit419.UploadFileSilent_Scope.OnRun()
    at Filter.InvokeWithFilter(NavMethodScope )
    at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit419.UploadFileSilent(NavText clientFilePath)
    at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit419.OnInvoke(Int32 memberId, Object[] args)
    at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit60001.OnRun_Scope.OnRun()
    at Filter.InvokeWithFilter(NavMethodScope )
    at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit60001.OnRun(INavRecordHandle εrec)
    at Microsoft.Dynamics.Nav.Runtime.NavCodeunit.DoRun(DataError errorLevel, NavRecord record)
    at Microsoft.Dynamics.Nav.Runtime.NavCodeunit.InvokeRun(Int32 objectId, Object[] args)t
    at Microsoft.Dynamics.Nav.Runtime.NavApplicationServer.InternalStartNas(Object config)
    Source: Microsoft.Dynamics.Nav.Ncl
    HResult: -2146233088

    I also got same error in my local system too
  • BardurKnudsenBardurKnudsen Member, Microsoft Employee Posts: 137
    As I read your question, you are running the code on the NAS in the service tier.
    The upload function reads a file from your client computer to the server. But when the code is executed from the NAS, there is no client - the dotnet exception also mentions that call-backs to the client is not possible - because there is no client.
    So if you intend to read the server's file directory, e.g. C:\temp\a.xml, then just read it as is. You haven't listed the exact scenario, but if it e.g. was an XML document, you would just write something like xmldom.load('C:\temp\a.xml'); or if it is something else, you can read it with a file variable: MyFile.OPEN('C:\temp\a.xml');
    Bardur Knudsen
    Microsoft - Dynamics NAV
  • NAVPRAKASHNAVPRAKASH Member Posts: 10
    I'm using the same Codeunit for both Manual run and NAS import purpose . So believe I have to use GUIAllowed in this case. Thanks for clarificatiion
  • Jatin_PatelJatin_Patel Member Posts: 200
    I am also facing same problem. Is there any solution?
    Jatin Patel
    Microsoft Dynamics NAV Consultant
    Jatin's Blog
  • nganassannganassan Member Posts: 1
    edited 2017-05-16
    You should look in CU419 and you have to use appropriate DotNet Variable e.g NAV2017 DirectoryHelper has property RunOnClient set to Yes, which throws Callback error, while DotNet Variable ServerDirectoryHelper works fine on Server with Job Queue
Sign In or Register to comment.