XMLport RTC Crash from ObjectDisposedException

arnhemb
Member Posts: 9
Hi All,
I am running NAV in a multi-tiered environment. When running any XMLport to import through a menu item, the XMLport runs successfully, but thereafter if the user changescompany (ctrl + O), the RTC crashes with the following error:
When checking the event log, there is the following error:
The odd thing is if I manually upload the file, open a stream and run the XMLport programmatically like so:
Could this be related to permissions? If so then why do the XMLports import sucessfully, and then only an error occurs on changing company?
Any assistance would be appreciated.
I am running NAV in a multi-tiered environment. When running any XMLport to import through a menu item, the XMLport runs successfully, but thereafter if the user changescompany (ctrl + O), the RTC crashes with the following error:
"The server <server name> is either unavailable or your connection has been lost. Do you want to attempt to reconnect".
When checking the event log, there is the following error:
Service: MicrosoftDynamicsNavServer
User: <user name>
Type: System.ObjectDisposedException
Message: Cannot access a closed file.
StackTrace:
at System.IO.__Error.FileNotOpen()
at System.IO.FileStream.Flush()
at Microsoft.Dynamics.Nav.Types.FileBufferedStream.Dispose(Boolean disposing)
at System.IO.Stream.Close()
at System.IO.Stream.Dispose()
at Microsoft.Dynamics.Nav.Runtime.NavStreamProvider.Dispose(Boolean disposing)
at Microsoft.Dynamics.Nav.Runtime.TreeObject.Dispose()
at Microsoft.Dynamics.Nav.Runtime.TreeHandler.InternalHostDispose()
at Microsoft.Dynamics.Nav.Runtime.TreeHandler.DisposeAllChildren()
at Microsoft.Dynamics.Nav.Runtime.TreeHandler.Dispose(Boolean disposing)
at Microsoft.Dynamics.Nav.Runtime.TreeObject.Dispose(Boolean disposing)
at Microsoft.Dynamics.Nav.Runtime.TreeObject.Dispose()
at Microsoft.Dynamics.Nav.Runtime.TreeHandler.InternalHostDispose()
at Microsoft.Dynamics.Nav.Runtime.TreeHandler.DisposeAllChildren()
at Microsoft.Dynamics.Nav.Runtime.NavCompany.Dispose(Boolean disposing)
at Microsoft.Dynamics.Nav.Runtime.TreeObject.Dispose()
at Microsoft.Dynamics.Nav.Service.Connection.GlobalTriggerCloseCompany()
at Microsoft.Dynamics.Nav.Service.NSService.<>c__DisplayClass43.<CloseConnection>b__41(Connection connection)
at Microsoft.Dynamics.Nav.Service.NSService.ExecuteOperation[T](String operationName, ServiceOperation`1 operation, Connection connection, Boolean revertLanguageChanges, WindowsIdentity impersonationIdentity)
Source: mscorlib
The odd thing is if I manually upload the file, open a stream and run the XMLport programmatically like so:
IF NOT UPLOADINTOSTREAM(Text001, '', 'All Files (*.*)|*.*', ltxtImportFileName, lstmInLocal) THEN EXIT; ImportMFOData.SETSOURCE(lstmInLocal); ImportMFOData.IMPORT;Then no error occurs (but this means I lose my request page).
Could this be related to permissions? If so then why do the XMLports import sucessfully, and then only an error occurs on changing company?
Any assistance would be appreciated.
0
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
- 322 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