Service Crash when creating Com object from RTC Client

quibbler
Member Posts: 9
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
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
Email: mra@abakion.com
Website: https://abakion.dk
0
Answers
-
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.dk0 -
Please intstall the latest hotfix build listed here:
https://mbs.microsoft.com/customersourc ... 09%20build
This could solve your problem.0 -
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.dk0 -
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.dk0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions