IndexOutOfBoundsException in the LagMonitor class

Post here your questions about the Java client / Android API for SFS2X

Moderators: Lapo, Bax

hhd90
Posts: 67
Joined: 21 Dec 2012, 05:17

IndexOutOfBoundsException in the LagMonitor class

Postby hhd90 » 17 Nov 2014, 04:17

My client was sometime crashed by IndexOutOfBoundsException:
java.lang.IndexOutOfBoundsException: Invalid index 9, size is 9\n\tat java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:251)\n\tat java.util.ArrayList.get(ArrayList.java:304)\n\tat sfs2x.client.util.LagMonitor.getLastPingTime(LagMonitor.java:80)
I guess this error is caused by multi-thread. Is this a bug in the Java API client?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: IndexOutOfBoundsException in the LagMonitor class

Postby Lapo » 17 Nov 2014, 11:45

Hi,
what version of the API are you using?
See the SmartFox.getVersion() method.

If it's not a recent version please make sure to upgrade here:
http://www.smartfoxserver.com/download/sfs2x#p=client
Lapo
--
gotoAndPlay()
...addicted to flash games
hhd90
Posts: 67
Joined: 21 Dec 2012, 05:17

Re: IndexOutOfBoundsException in the LagMonitor class

Postby hhd90 » 17 Nov 2014, 12:10

Smartfox version: 1.3.4
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: IndexOutOfBoundsException in the LagMonitor class

Postby Lapo » 17 Nov 2014, 12:15

What server version are you running?
Any ways in which we could try and reproduce the problem?

Can you show me your code for enabling the LagMonitor?

thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
hhd90
Posts: 67
Joined: 21 Dec 2012, 05:17

Re: IndexOutOfBoundsException in the LagMonitor class

Postby hhd90 » 18 Nov 2014, 10:47

I enabled the LagMonitor after login successful:

Code: Select all

private void onLogin(BaseEvent event) {
       _sfsClient.enableLagMonitor(Config.LAG_MONITOR);
      .............
}

My client has already released to end user. In my client (android), I have implemented a method to send a mail to developer when the client was crashed. These days, I receive a lot of mails about this error. But I can't reproduce this error when I try test.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: IndexOutOfBoundsException in the LagMonitor class

Postby Lapo » 18 Nov 2014, 11:05

Neither can I.
In any case we'll take a closer look and see if we can release a quick patch for you to try.

I'll post an update here as soon as possible.

Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: IndexOutOfBoundsException in the LagMonitor class

Postby Lapo » 18 Nov 2014, 11:17

UPDATE: I think it is an issue with internal synchronization, hence the difficulty in reproducing the issue on command.
We have fixed the issue.

It would be great if you could test the update and tell us if the problem has been removed.

If you want to do so, contact us directly by sending an email to our support@... email box, with a reference to this forum thread.

Hope it helps
Lapo

--

gotoAndPlay()

...addicted to flash games
hhd90
Posts: 67
Joined: 21 Dec 2012, 05:17

Re: IndexOutOfBoundsException in the LagMonitor class

Postby hhd90 » 20 Nov 2014, 04:48

Has this bug been fixed in the new version? When a new version is released?
In this time, I use try catch block to prevent this error. Thanks
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: IndexOutOfBoundsException in the LagMonitor class

Postby Lapo » 20 Nov 2014, 09:29

Did you read my previous message?
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Java / Android API”

Who is online

Users browsing this forum: No registered users and 18 guests