strange sfs exceptions

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

Moderators: Lapo, Bax

udikantz
Posts: 153
Joined: 24 Sep 2009, 09:36

strange sfs exceptions

Post by udikantz »

Im receiving these exceptions in the log files:

Code: Select all

INFO   | jvm 1    | 2010/10/20 06:36:11 | 06:36:11.683 - [ WARNING ] > Exception during userLost event handling: java.lang.NullPointerException
INFO   | jvm 1    | 2010/10/20 06:36:11 | Oct 20, 2010 6:36:11 AM it.gotoandplay.smartfoxserver.SmartFoxServer lostConnection
INFO   | jvm 1    | 2010/10/20 06:36:11 | WARNING: Exception during userLost event handling: java.lang.NullPointerException
INFO   | jvm 1    | 2010/10/20 06:36:11 | 06:36:11.683 - [ WARNING ] > Exception during client disconnection: java.lang.NullPointerException
INFO   | jvm 1    | 2010/10/20 06:36:11 | Oct 20, 2010 6:36:11 AM it.gotoandplay.smartfoxserver.SmartFoxServer lostConnection
INFO   | jvm 1    | 2010/10/20 06:36:11 | WARNING: Exception during client disconnection: java.lang.NullPointerException
INFO   | jvm 1    | 2010/10/20 06:36:11 | java.lang.NullPointerException
how do we eliminate these errors?
diwip games - co founder & CPO.

http://www.diwip.com
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Post by BigFIsh »

Maybe you were trying to disconnect an user that does not exist?

Is your AutoReloadExtension set to false? (As from memory, I was getting those exceptions when I reloaded my extension @ run-time following by disconnecting a user)

It could be worthwhile updating your sfs to the latest version if you have not already done so.
Smartfox's forum is my daily newspaper.
udikantz
Posts: 153
Joined: 24 Sep 2009, 09:36

Post by udikantz »

i have the latest sfs version.
i never reload extensions at runtime.

also getting similar errors on login requests.
diwip games - co founder & CPO.

http://www.diwip.com
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Sounds like you are handling the USER_LOST event on the server side in your extension and causing that error. Can you double check?
Lapo
--
gotoAndPlay()
...addicted to flash games
udikantz
Posts: 153
Joined: 24 Sep 2009, 09:36

Post by udikantz »

Lapo wrote:Sounds like you are handling the USER_LOST event on the server side in your extension and causing that error. Can you double check?
It seems like it something from sfs code. also today i got the following exception when using the Send Message Function from the admin tool on a certain zone:

INFO | jvm 1 | 2010/10/26 16:05:35 | 16:05:35.005 - [ WARNING ] > Exception in ExtensionHandler: java.lang.NullPointerException
INFO | jvm 1 | 2010/10/26 16:05:35 | Oct 26, 2010 4:05:35 PM it.gotoandplay.smartfoxserver.controllers.ExtensionHandler processEvent
INFO | jvm 1 | 2010/10/26 16:05:35 | WARNING: Exception in ExtensionHandler: java.lang.NullPointerException
INFO | jvm 1 | 2010/10/26 16:05:35 | Exception type: java.lang.NullPointerException
INFO | jvm 1 | 2010/10/26 16:05:35 | java.lang.NullPointerException
INFO | jvm 1 | 2010/10/26 16:05:35 | at it.gotoandplay.smartfoxserver.data.Zone.getChannelList(Zone.java:940)
INFO | jvm 1 | 2010/10/26 16:05:35 | at it.gotoandplay.smartfoxserver.controllers.SystemHandler.sendAdminMessage(SystemHandler.java:1685)
INFO | jvm 1 | 2010/10/26 16:05:35 | at it.gotoandplay.smartfoxserver.extensions.AdminExtension.sendAdminMessage(AdminExtension.java:1488)
INFO | jvm 1 | 2010/10/26 16:05:35 | at it.gotoandplay.smartfoxserver.extensions.AdminExtension.handleRequest(AdminExtension.java:353)
INFO | jvm 1 | 2010/10/26 16:05:35 | at it.gotoandplay.smartfoxserver.controllers.ExtensionHandler.processEvent(ExtensionHandler.java:454)
INFO | jvm 1 | 2010/10/26 16:05:35 | at it.gotoandplay.smartfoxserver.controllers.ExtensionHandler.run(ExtensionHandler.java:344)
INFO | jvm 1 | 2010/10/26 16:05:35 | at java.lang.Thread.run(Unknown Source)
diwip games - co founder & CPO.

http://www.diwip.com
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Looks like you are running an older version, is this PRO 1.6.9?
If not I would suggest to get the latest update.
Lapo
--
gotoAndPlay()
...addicted to flash games
udikantz
Posts: 153
Joined: 24 Sep 2009, 09:36

Post by udikantz »

Lapo wrote:Looks like you are running an older version, is this PRO 1.6.9?
If not I would suggest to get the latest update.
i have 1.6.9 admin console indicates that i am up to date.
diwip games - co founder & CPO.

http://www.diwip.com
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

t seems like it something from sfs code.

I am not saying that it is impossible but it's the least likely of the possibilities.
The error in the logs clearly shows that an unexpected NullPointer was captured while executing your event handler.
Sorry but I have to insist to double check your code, you haven't provided any info on what it does and how it could be exception proof.

Do a simple test: wrap the whole code in that handler with a:

Code: Select all

try
{
   // YOUR CODE HERE
}
catch(Exception e)
{
   trace("My Error Handler says:" + e);
}
If the exception escapes this "trap" it's definitely our fault, otherwise you should fix your code.
also today i got the following exception when using the Send Message Function from the admin tool on a certain zone:
Does it happen constantly? What code is being used?
Lapo
--
gotoAndPlay()
...addicted to flash games
udikantz
Posts: 153
Joined: 24 Sep 2009, 09:36

Post by udikantz »

Lapo wrote:
t seems like it something from sfs code.

I am not saying that it is impossible but it's the least likely of the possibilities.
The error in the logs clearly shows that an unexpected NullPointer was captured while executing your event handler.
Sorry but I have to insist to double check your code, you haven't provided any info on what it does and how it could be exception proof.

Do a simple test: wrap the whole code in that handler with a:

Code: Select all

try
{
   // YOUR CODE HERE
}
catch(Exception e)
{
   trace("My Error Handler says:" + e);
}
If the exception escapes this "trap" it's definitely our fault, otherwise you should fix your code.
also today i got the following exception when using the Send Message Function from the admin tool on a certain zone:
Does it happen constantly? What code is being used?
We are handling any event with your EventDispatcher model described on your docs, each event is surrounded with try and catch, and the only trace we got is the one i posted here. i can add another exception handling inside the event but i don't think it will be any difference.

about the admin message, it happened constantly and i had to reboot the server to make it work again
diwip games - co founder & CPO.

http://www.diwip.com
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

The NullPointer could be fired by the dispatcher, have you checked that part of the code?
Lapo
--
gotoAndPlay()
...addicted to flash games
udikantz
Posts: 153
Joined: 24 Sep 2009, 09:36

Post by udikantz »

Lapo wrote:The NullPointer could be fired by the dispatcher, have you checked that part of the code?
hey i have added more exception handling and could get a strack trace out of the exceotion

Code: Select all

INFO   | jvm 1    | 2010/11/06 16:38:48 | Nov 6, 2010 4:38:48 PM it.gotoandplay.smartfoxserver.SmartFoxServer lostConnection
INFO   | jvm 1    | 2010/11/06 16:38:48 | WARNING: Exception during client disconnection: java.lang.NullPointerException
INFO   | jvm 1    | 2010/11/06 16:38:48 | java.lang.NullPointerException
INFO   | jvm 1    | 2010/11/06 16:38:48 | 	at java.util.concurrent.ConcurrentHashMap.containsKey(Unknown Source)
INFO   | jvm 1    | 2010/11/06 16:38:48 | 	at it.gotoandplay.smartfoxserver.EventWriter.isNpc(EventWriter.java:472)
INFO   | jvm 1    | 2010/11/06 16:38:48 | 	at it.gotoandplay.smartfoxserver.EventWriter.handleEvent(EventWriter.java:133)
INFO   | jvm 1    | 2010/11/06 16:38:48 | 	at it.gotoandplay.smartfoxserver.controllers.SystemHandler.sendBuddyListUpdate(SystemHandler.java:3433)
INFO   | jvm 1    | 2010/11/06 16:38:48 | 	at it.gotoandplay.smartfoxserver.data.Zone.removeName(Zone.java:408)
INFO   | jvm 1    | 2010/11/06 16:38:48 | 	at it.gotoandplay.smartfoxserver.SmartFoxServer.lostConnection(SmartFoxServer.java:1563)
INFO   | jvm 1    | 2010/11/06 16:38:48 | 	at it.gotoandplay.smartfoxserver.SmartFoxServer.readIncomingMessages(SmartFoxServer.java:998)
INFO   | jvm 1    | 2010/11/06 16:38:48 | 	at it.gotoandplay.smartfoxserver.EventReader.run(EventReader.java:32)
INFO   | jvm 1    | 2010/11/06 16:38:48 | 	at java.lang.Thread.run(Unknown Source)

here is what i could find so far about the login exception:
there is a problem in force login and then it cause an exception:


Code: Select all

INFO   | jvm 1    | 2010/11/06 16:48:40 | 16:48:40.166 - [ INFO ] > Problems with Force-Login, Could not disconnect old user: 1:100000251666271
INFO   | jvm 1    | 2010/11/06 16:48:40 | Nov 6, 2010 4:48:40 PM it.gotoandplay.smartfoxserver.SmartFoxServer forceUserReconnection
INFO   | jvm 1    | 2010/11/06 16:48:40 | INFO: Problems with Force-Login, Could not disconnect old user: 1:100000251666271

INFO   | jvm 1    | 2010/11/06 16:48:40 | java.lang.NullPointerException
INFO   | jvm 1    | 2010/11/06 16:48:40 | 16:48:40.218 - [ WARNING ] > SystemHandler: Invalid login request > java.lang.NullPointerException
INFO   | jvm 1    | 2010/11/06 16:48:40 | Nov 6, 2010 4:48:40 PM it.gotoandplay.smartfoxserver.controllers.SystemHandler handleLoginRequest
INFO   | jvm 1    | 2010/11/06 16:48:40 | WARNING: SystemHandler: Invalid login request > java.lang.NullPointerException
diwip games - co founder & CPO.

http://www.diwip.com
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Ok so the problem is that at login time the user has another connection already pending in the system and SmartFox is not able to get rid of the previous connection.
Usually this happens when user refresh their pages like crazy thinking that it will help connecting or so :P Actually this can create quite a number of nasty issues especially with IE where at times it causes a ghost connection (the browser does not release the socket resources)
Lapo
--
gotoAndPlay()
...addicted to flash games
udikantz
Posts: 153
Joined: 24 Sep 2009, 09:36

Post by udikantz »

Lapo wrote:Ok so the problem is that at login time the user has another connection already pending in the system and SmartFox is not able to get rid of the previous connection.
Usually this happens when user refresh their pages like crazy thinking that it will help connecting or so :P Actually this can create quite a number of nasty issues especially with IE where at times it causes a ghost connection (the browser does not release the socket resources)
anything can be done here?
diwip games - co founder & CPO.

http://www.diwip.com
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Not much can be done. The server is already protecting itself from these client misbehaviors
Lapo
--
gotoAndPlay()
...addicted to flash games
udikantz
Posts: 153
Joined: 24 Sep 2009, 09:36

Post by udikantz »

Lapo wrote:Not much can be done. The server is already protecting itself from these client misbehaviors

what about this exception:

Code: Select all

INFO   | jvm 1    | 2010/11/14 03:51:59 | 03:51:59.357 - [ WARNING ] > Exception during client disconnection: java.lang.NullPointerException
INFO   | jvm 1    | 2010/11/14 03:51:59 | Nov 14, 2010 3:51:59 AM it.gotoandplay.smartfoxserver.SmartFoxServer lostConnection
INFO   | jvm 1    | 2010/11/14 03:51:59 | WARNING: Exception during client disconnection: java.lang.NullPointerException
INFO   | jvm 1    | 2010/11/14 03:51:59 | java.lang.NullPointerException
INFO   | jvm 1    | 2010/11/14 03:51:59 | 	at java.util.concurrent.ConcurrentHashMap.containsKey(Unknown Source)
INFO   | jvm 1    | 2010/11/14 03:51:59 | 	at it.gotoandplay.smartfoxserver.EventWriter.isNpc(EventWriter.java:472)
INFO   | jvm 1    | 2010/11/14 03:51:59 | 	at it.gotoandplay.smartfoxserver.EventWriter.handleEvent(EventWriter.java:133)
INFO   | jvm 1    | 2010/11/14 03:51:59 | 	at it.gotoandplay.smartfoxserver.controllers.SystemHandler.sendBuddyListUpdate(SystemHandler.java:3433)
INFO   | jvm 1    | 2010/11/14 03:51:59 | 	at it.gotoandplay.smartfoxserver.data.Zone.removeName(Zone.java:408)
INFO   | jvm 1    | 2010/11/14 03:51:59 | 	at it.gotoandplay.smartfoxserver.SmartFoxServer.lostConnection(SmartFoxServer.java:1563)
INFO   | jvm 1    | 2010/11/14 03:51:59 | 	at it.gotoandplay.smartfoxserver.SmartFoxServer.readIncomingMessages(SmartFoxServer.java:998)
INFO   | jvm 1    | 2010/11/14 03:51:59 | 	at it.gotoandplay.smartfoxserver.EventReader.run(EventReader.java:32)
INFO   | jvm 1    | 2010/11/14 03:51:59 | 	at java.lang.Thread.run(Unknown Source)
and also this one:

Code: Select all

user lost: 1:1078107266
INFO   | jvm 1    | 2010/11/14 04:25:39 | 04:25:39.558 - [ WARNING ] > Exception during client disconnection: java.lang.NullPointerException
INFO   | jvm 1    | 2010/11/14 04:25:39 | Nov 14, 2010 4:25:39 AM it.gotoandplay.smartfoxserver.SmartFoxServer lostConnection
INFO   | jvm 1    | 2010/11/14 04:25:39 | WARNING: Exception during client disconnection: java.lang.NullPointerException
INFO   | jvm 1    | 2010/11/14 04:25:39 | java.lang.NullPointerException
The userLost event handler is very important in our game,
if an exception occure some data may get out of synch.

When im looking on the logs, it seems like this particular users did not connect and disconnect rapidly. and this errors come up very often. it gets some db data out of synch. need some solution.
diwip games - co founder & CPO.

http://www.diwip.com
Post Reply