Marcio 2 Posted February 25, 2019 (edited) I have an android application that synchronizes data with a DataSnap server, did the tests with version 10.3 and had no problems with win32. I updated to version 10.3.1 and when calling the function, the java.lang.illegalStateException error occurs, as per the attachment. In win32 the error does not occur and it works perfectly, does anyone know what it can be? I was debugging until the moment where the error occurs, see the last image.. Thank you Edited February 25, 2019 by Marcio Share this post Link to post
Dave Nottage 557 Posted February 25, 2019 When the crash occurs as per your first image, can you click "Break", so that the callstack shows, please? Then present here what the callstack actually shows (preferably paste the text, rather than a picture) Share this post Link to post
Marcio 2 Posted February 25, 2019 43 minutes ago, Dave Nottage said: When the crash occurs as per your first image, can you click "Break", so that the callstack shows, please? Then present here what the callstack actually shows (preferably paste the text, rather than a picture) Dave, Only Android , win32 work fine, and 10.3 work fine too. unit System.Internal.ExcUtils; line 839 {$IFDEF ANDROID} procedure DoRaiseJNIExceptionCallBack(const JNIExceptionClassName: string; const Msg: string); begin raise EJNIException.CreateWithClassName(JNIExceptionClassName, Msg); end; {$ENDIF} Share this post Link to post
Dave Nottage 557 Posted February 26, 2019 I referred to the callstack, not the actual code. The Callstack window is the one in the very top left of your first picture. It's possible to copy/paste what is inside that window. Share this post Link to post
Marcio 2 Posted February 26, 2019 (edited) 10 hours ago, Dave Nottage said: I referred to the callstack, not the actual code. The Callstack window is the one in the very top left of your first picture. It's possible to copy/paste what is inside that window. Dave, In moment of error CallStack The result this function is TFDJSONDataSets LDataSetList:= ClientModule1.ServerMethodsClient.GetDatabase('1','1234',vErros, 1670, '',''); The TFDJSONDataSets is returned by the DataSnap Rest, but when it receives this return for appllication and will convert is that the error occurs System._DbgExcNotify(-1634508784,0x9b16e5a8,0x9c6b1159,0x9b16e5a8,0x9c6b1159) System.NotifyReRaise(0x9b16e5a8,0x9c6b1159) System._RaiseAtExcept(0x9b16e5a8,0x9c6b1159) System._RaiseExcept(0x9b16e5a8) System.Internal.Excutils.DoRaiseJNIExceptionCallBack('class java.lang.IllegalStateException','java.lang.IllegalStateException: Cannot set request property after connection is made') Androidapi.Jni.HandleJNIException(0xb30b95a0) Androidapi.Jnimarshal.ExecJNI(0x9e9364c0,0x9b777c08) :9D237614 DispatchToImport :9D25B930 dispatch_first_stage_intercept System.Net.Httpclient.Android.TAndroidHTTPClient.DoExecuteRequest(0xae4a3240,0x9984c900,@0x9e9367e8: 0xb30b9480,0x9980f5e0) System.Net.Httpclient.THTTPClient.ExecuteHTTPInternal(0xae4a3240,0x9984c97c,0x9980f5e0,0xb30b94cc) System.Net.Httpclient.THTTPClient_ExecuteHTTP_ActRec._0_Body(0x998cd080) :9D117836 __stub_in36s__ZN6System3Net10Httpclient30THTTPClient_ExecuteHTTP_ActRec7_0_BodyEv System.Classes.TAnonymousThread.Execute(0x99888768) System.Classes.ThreadProc(0x99888768) System.ThreadWrapper(0xae595e18) :B6CE5E34 __pthread_start(void*) :B6CC056C __start_thread :00000000 ?? Edited February 26, 2019 by Marcio Share this post Link to post
Dave Nottage 557 Posted February 26, 2019 Thanks! Given the code in TAndroidHTTPClient.DoExecuteRequest, it would seem that somehow a connection is being made before DoExecuteRequest is executed, because setRequestProperty is definitely called before connect (and it is the only place connect is called). It might be that DoExecuteRequest is somehow being called twice, however I could not say without a test project. Share this post Link to post
Dmitry Arefiev 101 Posted February 27, 2019 The patch and instruction is published there: https://quality.embarcadero.com/browse/RSP-23656 1 Share this post Link to post
Marcio 2 Posted February 27, 2019 (edited) 2 hours ago, Dmitry Arefiev said: The patch and instruction is published there: https://quality.embarcadero.com/browse/RSP-23656 Thank you Dmitry! Thank you Dave! I made the changes indicated in the patch and it worked perfectly! Edited February 27, 2019 by Marcio Share this post Link to post