Jump to content
Sign in to follow this  
Marcio

Erro 10.3.1 java.lang.IllegalStateException

Recommended Posts

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

Erro java.lang.illegal.jpg

Erro java.lang.illegal_2.jpg

Erro java.lang.illegal_3.jpg

Edited by Marcio

Share this post


Link to post

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
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

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
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 by Marcio

Share this post


Link to post

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×