NullPointerException on serverside setUserVariables

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

Gamebrew
Posts: 57
Joined: 25 May 2007, 06:18

NullPointerException on serverside setUserVariables

Postby Gamebrew » 26 Sep 2009, 16:43

Hi, I am constantly (every 5-10 minutes with around 5 users at a time) getting this error for about two months now. I'm using SFS 1.6.6 and Java server side. The game seems to be running fine even with the error, but its probably messing up peoples UserVariables randomly. It doesn't make sense cause everything I pass is NOT null (see null check before call) so it must be the underlying code, or I'm missing some steps. Please help!

Code: Select all

HashMap uvars=new HashMap();
if(helper==null||user==null||uvars==null||primary_data==null) log("NULL ERROR");
uvars.put("primary_data",new UserVariable(primary_data,UserVariable.TYPE_STRING));
helper.setUserVariables(user,uvars,false); //This is line 611

Code: Select all

08:23:42.913 - [ WARNING ] > Exception in ExtensionHandler: java.lang.NullPointerException
Exception type: java.lang.NullPointerException
java.lang.NullPointerException
at it.gotoandplay.smartfoxserver.data.User.setVariable(User.java:661)
at it.gotoandplay.smartfoxserver.controllers.SystemHandler.setUserVariable(SystemHandler.java:2233)
at it.gotoandplay.smartfoxserver.extensions.ExtensionHelper.setUserVariables(ExtensionHelper.java:892)
at com.gamebrew.LilithsWorld.onRequest(LilithsWorld.java:611)
at com.gamebrew.ZoneBase.handleRequest(ZoneBase.java:125)
at it.gotoandplay.smartfoxserver.controllers.ExtensionHandler.processEvent(ExtensionHandler.java:500)
at it.gotoandplay.smartfoxserver.controllers.ExtensionHandler.run(ExtensionHandler.java:344)
at java.lang.Thread.run(Unknown Source)
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 28 Sep 2009, 10:27

With only 5 users connected is almost like being in a test environment.
Is there any way in which you can reproduce the problem at will?
Lapo
--
gotoAndPlay()
...addicted to flash games
Gamebrew
Posts: 57
Joined: 25 May 2007, 06:18

Postby Gamebrew » 04 Oct 2009, 03:57

It's hard to reproduce it just happens once in a while if I login in and out many times, and it never happens when I try on my local dev computer. Is there any clue in the code line [User.java:661] that can give me an idea of what's happening? I have 3 other games running on the same server and I'm not getting that error from them, just the new game I added.

Thanks!
Gamebrew
Posts: 57
Joined: 25 May 2007, 06:18

Postby Gamebrew » 08 Oct 2009, 20:37

I've been trying to debug this still for a week and had no luck. Any ideas on what is on that line number that could cause a null exception?
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 12 Oct 2009, 08:05

Hi,
no. I can file this in our bug db and run some load testing to see if we can reproduce the problem but at the moment we haven't heard of a similar problem from other users. We also have an application that uses lots of server side User Variables and we didn't encounter this issue.

If you can provide any other information that could help us better understand the scenario, let us know
Lapo

--

gotoAndPlay()

...addicted to flash games
Himmelweiss
Posts: 7
Joined: 25 Oct 2009, 10:04
Contact:

Postby Himmelweiss » 26 Dec 2009, 03:27

Old thread, but i'm in an similiar situation. It only happens on the live server randomly and quite often, i can't reproduce it on my local dev computer.
The only difference between the two servers is that the live server is a 64bit system and my local dev system 32bit. Both linux/Lenny 5.0.
On the live system the correct 64bit wrapper and JVM is installed.

I'm using SFS 1.6.6.


Code: Select all

[ WARNING ] [id: 36] (ExtensionHandler.processEvent): Exception in ExtensionHandler: java.lang.NullPointerException


It's hard for me to locate the error in the extension. But maybe id: 36 helps somewhat ? I'm not even sure if setUserVariables is causing this in my case.
Himmelweiss
Posts: 7
Joined: 25 Oct 2009, 10:04
Contact:

Postby Himmelweiss » 26 Dec 2009, 04:03

updated to 1.6.8 on both live and dev computers. I will report back if the error still occurs.

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 17 guests