I installed 1.6.6 pro to resolve an issue that I had on 1.6.2 pro which presented issues on it's own but I will not get into that on this thread for those issues I will leave them to the other thread.
The problem that I am having is when sending a raw str message to the server from more than 2 users at a time. I should probably point out that on the client side I use as3 and on the server I use java. I get the warning message:
10:41:00.906 - [ WARNING ] > String message in wrong format: b%nwgs%0% -> java.lang.ArrayIndexOutOfBoundsException: -1
So Initially I thought I was doing something wrong and I tried a few different things but here is the original function on the client side:
//HEADER_REQUEST_SELF_INFO = "nwgs"
public function sendNotificationWaitingGameStart():void{
var arrSend:Array = new Array();
sfs.sendXtMessage( extension , HEADER_NOTIFY_WAITING_GAME_START , arrSend , SmartFoxClient.XTMSG_TYPE_STR , 0 );
}
I tried:
sfs.sendXtMessage( extension , HEADER_NOTIFY_WAITING_GAME_START , null , SmartFoxClient.XTMSG_TYPE_STR , 0 );
Also tried:
public function sendNotificationWaitingGameStart():void{
var arrSend:Array = new Array();
arrSend.push( "a" );
arrSend.push( "b" );
arrSend.push( "c" );
arrSend.push( "d" );
sfs.sendXtMessage( extension , HEADER_NOTIFY_WAITING_GAME_START , arrSend , SmartFoxClient.XTMSG_TYPE_STR , 0 );
}
resulted in multiple:
11:19:21.468 - [ WARNING ] > String message in wrong format: b%nwgs%0%a%b%c%d% -> java.lang.ArrayIndexOutOfBoundsException: -1
I also tried other things but it is really strange because this ONLY happens when there is more than 2 users sending it at once. Meaning if there is just 1 or 2 users sending this to the server then there is no issue at all but if there is 3 or more I get this from the server:
10:41:00.906 - [ WARNING ] > String message in wrong format: b%nwgs%0% -> java.lang.ArrayIndexOutOfBoundsException: -1
10:41:00.906 - [ WARNING ] > String message in wrong format: b%nwgs%0% -> java.lang.ArrayIndexOutOfBoundsException: -1
10:41:00.906 - [ WARNING ] > String message in wrong format: b%nwgs%0% -> java.lang.ArrayIndexOutOfBoundsException: -1
Also this warning message that is shown is not from my code and if it was I would get a stack dump with the details of the error, it happens before I get:
public void handleRequest(String cmd, String[] params, User u, int fromRoom){}
I considered posting this as a bug in the bugs section but I'm not entirely sure that this is a bug because it is still possible that I'm doing something wrong. I would appreciate any input on getting this resolved.
Thanks
java.lang.ArrayIndexOutOfBoundsException
-
- Posts: 7
- Joined: 09 Aug 2009, 04:04
-
- Posts: 7
- Joined: 09 Aug 2009, 04:04
by removing the very last parameter roomId defaults to -1 which I did try along with many other things but the only way I can prevent that warning message from coming up is to set the server config.xml logging level to a very low setting like SEVERE instead of the FINEST which I normally use.
I wonder if there is anyone else who uses the raw str method of sending messages that has this exact same problem? or am I alone on this one
I wonder if there is anyone else who uses the raw str method of sending messages that has this exact same problem? or am I alone on this one
Just in case this helps anyone else, I had this error message and it turned out it had nothing to do with what/how how I was sending it. It was because I had some bad code on my server side within the handleRequest function.
I presume SFS is catching that particular error on its side and I just happened to code something which caused that error to be thrown, but is a bit misleading
I presume SFS is catching that particular error on its side and I just happened to code something which caused that error to be thrown, but is a bit misleading
Return to “SmartFoxServer 1.x Discussions and Help”
Who is online
Users browsing this forum: No registered users and 43 guests