Options

Service Crash when creating Com object from RTC Client

quibblerquibbler Member Posts: 9
edited 2010-10-11 in NAV Three Tier
I have a problem I´m unable to figure out what the solutions could be

We are running the setup in a 2-tier enviroment (SQL server and Services on same machine)

When I run my functionality on the Server I do not get any problems, the error occurs only when we try to run it from the RTC client outside the server the Service crashes and I get following information. (if I run the Classic Client outside the server no problems)

The server "net.[url=tcp://navision:7046/DynamicsNAV/Service]tcp://navision:7046/DynamicsNAV/Service[/url]" is either unavailable or your connection has been lost. Do you want to attempt to reconnect?”

> Yes

“The connection to the server has been lost. The application will close.”

I was able to debug with messages and figure out where the problem occurs and the following code is the problem

***********

IF ISCLEAR(clientFso) THEN CREATE(clientFso, FALSE, TRUE);

clientFSO is a variable to the automation : 'Microsoft Scripting Runtime'.FileSystemObject

***********

and this seems to be the problem when trying to create the object on the Client PC (but this only occurs through the RTC klient)

Anybody knows what this could be

From the log fil I get following information:

Service: MicrosoftDynamicsNavServer$NAV2
Type: System.InvalidCastException
Message: Unable to cast object of type 'System.Int32' to type 'Microsoft.Dynamics.Nav.Types.AutomationMethodResponse'.
StackTrace:
at Microsoft.Dynamics.Nav.Runtime.NavApplicationMethod.InvokeMethod(Object obj, String methodName, Object[] args)
at Microsoft.Dynamics.Nav.Service.NSField.ActionField(NavConnection con)
at Microsoft.Dynamics.Nav.Service.NSField.Action(NavConnection connection)
at Microsoft.Dynamics.Nav.Service.NSService.<>c__DisplayClass21.<ActionField>b__20(Connection connection)
at Microsoft.Dynamics.Nav.Service.NSService.ExecuteOperation[T](String operationName, ServiceOperation`1 operation, Connection connection, Boolean revertLanguageChanges, WindowsIdentity impersonationIdentity)
Source: Microsoft.Dynamics.Nav.Ncl
Type: System.Reflection.TargetInvocationException
Message: Exception has been thrown by the target of an invocation.
StackTrace:
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.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.Dynamics.Nav.Runtime.NavApplicationMethod.InvokeMethod(Object obj, String methodName, Object[] args)
Source: mscorlib
Type: System.InvalidCastException
Message: Unable to cast object of type 'System.Int32' to type 'Microsoft.Dynamics.Nav.Types.AutomationMethodResponse'.
StackTrace:
at Microsoft.Dynamics.Nav.Service.NSClientCallback.CreateAutomationObject(Guid classId, String licenseKey, Boolean newServer)
at Microsoft.Dynamics.Nav.Runtime.NavAutomation.Create(DataError errorLevel, Boolean newServer, Boolean clientSide)
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit75400.EmailPostedSalesInvoice(INavRecordHandle header, Boolean includePDF, Boolean includeImages, Boolean includeXML) in c:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer$NAV2\source\Codeunit\Codeunit75400.cs:line 578
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit75400.OnInvoke(Int32 memberId, Object[] args) in c:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer$NAV2\source\Codeunit\Codeunit75400.cs:line 0
at Microsoft.Dynamics.Nav.Runtime.NavApplicationObjectBase.Invoke(Int32 methodId, Object[] arguments)
at Microsoft.Dynamics.Nav.BusinessApplication.Page75500.Control1160840030_OnAction() in c:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer$NAV2\source\Page\Page75500.cs:line 117
Source: Microsoft.Dynamics.Nav.Service
Senior Development Manager, Supply Chain Box at Abakion A/S with 10+ years of experience as Developer
Email: mra@abakion.com
Website: https://abakion.dk

Answers

  • Options
    deV.chdeV.ch Member Posts: 543
    Do you have any more code that uses the automation variable?

    I can't reproduce this problem, for me it's working fine.

    Are you using the latest builds for Client and Service?
  • Options
    quibblerquibbler Member Posts: 9
    Yes this is the latest version RTC 2009 SP1 version: build 6.0.29626.0

    I do not currently have other code using the automation variable.
    Senior Development Manager, Supply Chain Box at Abakion A/S with 10+ years of experience as Developer
    Email: mra@abakion.com
    Website: https://abakion.dk

  • Options
    deV.chdeV.ch Member Posts: 543
    Please intstall the latest hotfix build listed here:
    https://mbs.microsoft.com/customersourc ... 09%20build

    This could solve your problem.
  • Options
    quibblerquibbler Member Posts: 9
    Update to this Tread

    I have now updated to latest build and now the Service don´t crash but I now get following error

    Microsoft Dynamics NAV

    This message is for C/AL programmers: Unable to create an instance of Automation Server System.__ComObject with CLSID = c8c4804c-89ba-4291-ab58-4c6050b65175 Retrieving the COM class factory for component with CLSID {C8C4804C-89BA-4291-AB58-4C6050B65175} failed due to the following error: 80040154..
    OK
    Senior Development Manager, Supply Chain Box at Abakion A/S with 10+ years of experience as Developer
    Email: mra@abakion.com
    Website: https://abakion.dk

  • Options
    quibblerquibbler Member Posts: 9
    okey, problem seems to be solved after registering the com object again on then Client machine, so the real solution was to update to latest build in this case.
    Senior Development Manager, Supply Chain Box at Abakion A/S with 10+ years of experience as Developer
    Email: mra@abakion.com
    Website: https://abakion.dk

Sign In or Register to comment.