Crashing the middle tier using CC2
absolutelyfreeweb
Member Posts: 104
Consider code below to connect to a socket and read data:
Declare variables:
CC2
Automation
'Navision Communication Component version 2'.CommunicationComponent
SBA
Automation
'Navision Socket Bus Adapter'.SocketBusAdapter
OutMsg
Automation
'Navision Communication Component version 2'.OutMessage
InMsg
Automation
'Navision Communication Component version 2'.InMessage
OutS
OutStream
InS
Instream
This code works in classic. In RTC it crashes the middletier service at the InS.READ line with
Declare variables:
CC2
Automation
'Navision Communication Component version 2'.CommunicationComponent
SBA
Automation
'Navision Socket Bus Adapter'.SocketBusAdapter
OutMsg
Automation
'Navision Communication Component version 2'.OutMessage
InMsg
Automation
'Navision Communication Component version 2'.InMessage
OutS
OutStream
InS
Instream
IF ISCLEAR(CC2) THEN
CREATE(CC2);
IF ISCLEAR(SBA) THEN
CREATE(SBA);
CC2.AddBusAdapter(SBA, 0);
OutMsg:= CC2.CreateoutMessage('Sockets://100.100.100.57:5000');
OutS:= OutMsg.GetStream();
OutMsg.SendWaitForReply(0);
InMsg:= OutMsg.SendWaitForReply(2000);
IF (ISCLEAR(InMsg)) THEN BEGIN
MESSAGE('error');
END ELSE BEGIN
InS:= InMsg.GetStream();
InS.READ(txt);
MESSAGE(txt);
END;
This code works in classic. In RTC it crashes the middletier service at the InS.READ line with
Type: System.NotImplementedException
Message: The method or operation is not implemented.
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.NotImplementedException
Message: The method or operation is not implemented.
StackTrace:
at System.Runtime.InteropServices.ComTypes.IStream.Seek(Int64 dlibMove, Int32 dwOrigin, IntPtr plibNewPosition)
at Microsoft.Dynamics.Nav.Runtime.NavStreamProvider.ComStream.Seek(Int64 offset, SeekOrigin origin)
at Microsoft.Dynamics.Nav.Runtime.NavInStream.Microsoft.Dynamics.Nav.Runtime.INavStreamReader.ReadByte()
at Microsoft.Dynamics.Nav.Runtime.ALStream.ReadBytes(INavStreamReader reader, DataError dataError, Int32 length, ReadOptions readoptions)
at Microsoft.Dynamics.Nav.Runtime.ALStream.ALRead(INavStreamReader reader, DataError dataError, NavText& value, Int32 length)
at Microsoft.Dynamics.Nav.Runtime.ALStream.ALReadNavValue(INavStreamReader reader, DataError dataError, INavValueMetadata metadata, NavValue& value, Int32 length)
at Microsoft.Dynamics.Nav.Runtime.ALStream.ALRead[T](INavStreamReader reader, DataError dataError, ByRef`1 passByRef, Int32 length)
Any idea why this is happening? 0
Comments
-
since I started this, I'll end it with the solution:
this was an error in the windows client, but had been already resolved.
It works in 2009 R2 build 346990
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions