I’m trying to migrate my servers from .net 4.8 to .net core to run it in linux.
But when my .net 4.8client tries to fill some dataSet using the RemObjects.DataAbstract.RemoteDataAdapter.Fill(…) it gets the Object reference not set to an instance of an object. message.
RemObjects.SDK.Types.ServerException: An exception occurred on the server: Object reference not set to an instance of an object.
em RemObjects.SDK.Message.ProcessException()
em RemObjects.SDK.BinMessage.InternalReadFromStream(Stream stream)
em RemObjects.SDK.Message.ReadFromStream(Stream stream)
em RemObjects.SDK.IpSuperTcpClientChannel.IntDispatch(Stream request, IMessage response)
em RemObjects.SDK.ClientChannel.Dispatch(IMessage message)
em RemObjects.SDK.DynamicRequest.InternalMakeRequest()
em RemObjects.SDK.DynamicRequest.MakeRequest()
em RemObjects.DataAbstract.RemoteDataAdapter.SendFillRequest(DataSet dataset, String[] tableNames, TableRequestInfo[] tableRequests, WhereExpression[] whereClauses, Boolean applySchema, IList`1 tablesThatNeedSchema)
em RemObjects.DataAbstract.DataAdapter.InternalFill(DataSet dataset, String[] tableNames, TableRequestInfo[] tableRequestInfo, WhereExpression[] whereClauses, Boolean applySchema)
em RemObjects.DataAbstract.DataAdapter.Fill(DataSet dataset, String[] tableNames, TableRequestInfo[] tableRequestInfo)
em AdaptiveSoft.AdaptiveFW.FormPadraoManutencaoGrid.PreencheGrid()
em AdaptiveSoft.AdaptiveFW.FormPadraoManutencaoGrid.InicializaTela()
em AdaptiveSoft.AdaptiveFW.FormBase.doLoadForm()
em AdaptiveSoft.AdaptiveFW.FormBase.FormBase_Load(Object sender, EventArgs e)
em System.EventHandler.Invoke(Object sender, EventArgs e)
em System.Windows.Forms.Form.OnLoad(EventArgs e)
em DevExpress.XtraEditors.XtraForm.OnLoad(EventArgs e)
em System.Windows.Forms.Form.OnCreateControl()
em System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
em System.Windows.Forms.Control.CreateControl()
em System.Windows.Forms.Control.WmShowWindow(Message& m)
em System.Windows.Forms.Control.WndProc(Message& m)
em System.Windows.Forms.ScrollableControl.WndProc(Message& m)
em System.Windows.Forms.Form.WmShowWindow(Message& m)
em System.Windows.Forms.Form.WndProc(Message& m)
em DevExpress.XtraEditors.DForm.WndProc(Message& m)
em DevExpress.XtraEditors.XtraForm.WndProc(Message& msg)
em System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
em System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
em System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Is there a sample project that uses DataAbastractServer in a .netcore application?
It should be a property on the exception object in the client. For example, add a try/catch inside AdaptiveSoft.AdaptiveFW.FormPadraoManutencaoGrid.PreencheGrid around the call to Fill, and in the catch clause, inspect the Exception or log the ServerStackTrace (I tink that’s what its called, maybe serverCallStack) property.
are you able to run the server in the debugger, and enable to break on all exceptions, to see of you can catch the exception there?
Alternatively, pls try hooking up the OnServiceMethodException even on your service class (I assume a DataService descendant), and see if you get the exception and details reported there.
There should be an event on the server channel, yes. But really, if theres an exception in the server, it should break in VS, when configured properly. Can you also make sure that “Just my Code” is turned off in Debugger options, and that ALL exceptions types are checked (unchecked?) so they will be broken on?
System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=RemObjects.DataAbstract.Server
StackTrace:
at RemObjects.DataAbstract.Server.DataAbstractService_Invoker.Invoke_GetData(IROService __Instance, IMessage __Message, IServerChannelInfo __ServerChannelInfo, ResponseOptions& __oResponseOptions)
oddly, I had to switch the client to connect to http://8099/bin, and to remove the AES envelope for it to work. It seems that something mismatches between the client and server projects you sent.
I will probably run out of time today before finding anything, but I’ll resume first ting tomorrow.
Update, i’ve narrowed it down more (it’s something to do with the newfangled DependencyInjection stuff, for some reason the Activator doe snot instantiate the service type correctly, and returns n il instead.
I have no idea why yet, so I will need to dive deeper, tomorrow.
Side note: you’ll also need to create your connection manager earlier; else, by the time you get to the code that does it now, there’ll already be one and you’ll get an exception on that.