_server.loginUser fails

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

Moderators: Lapo, Bax

Ganius
Posts: 92
Joined: 13 Feb 2007, 12:49

_server.loginUser fails

Postby Ganius » 20 Oct 2008, 11:31

Hi Lapo.

We've come across an issue with users logging into the smartfox server.

I'm using the following code:

Code: Select all

var obj = _server.loginUser(nick, pass, chan, true);
if (obj.success == false)
{
     error = obj.error;
     debugtrace ("Login error: "+error);
     response._cmd = "logBad";
     response.err = error;
     _server.sendResponse(response, -1, null, chan);
}
else
{
    ....
}

This works in essence, but sometimes (1 out of 30 say) we do get obj.success == false, but obj.error is null! I know for a fact that 'nick' and 'pass' are correct, and I also know that the name is not in use already (plus the fact that we don't get the 'This user name is already taken' message). We get null!!

So this is very hard to debug!!

Can you shed any light on what's happening here please? We're getting members call up and tell us they can't login, and since there is no real direction for us to look here due to obj.error being null, it's hard for us to solve quickly!

Thanks,
G.
Ganius
Posts: 92
Joined: 13 Feb 2007, 12:49

Postby Ganius » 21 Oct 2008, 10:01

After trying to trap this error with:

Code: Select all

if (obj.error == null)
{
     ...
}


I realised that it's not returning a null value at all, but rather a string ' null'. I put this in quotes to emphasize that there is a space before the word null.

Hmmmmmm

G.
User avatar
Lapo
Site Admin
Posts: 23009
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 21 Oct 2008, 21:22

Sounds like there is a NullPointerException, you should check your logs and look for similar errors
Lapo
--
gotoAndPlay()
...addicted to flash games
Ganius
Posts: 92
Joined: 13 Feb 2007, 12:49

Postby Ganius » 13 Nov 2008, 13:06

Hi Lapo

I've looked at the logs, and at the times that _server.loginUser returns ' null', we have no null pointer exceptions at all, or even around these times...

Cheers,
G.
User avatar
Lapo
Site Admin
Posts: 23009
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 13 Nov 2008, 13:56

Dunno, we should take a look at the actual client/server code.
In case you need it you can contact us directly for a dedicated support ticket.
Lapo

--

gotoAndPlay()

...addicted to flash games
Ganius
Posts: 92
Joined: 13 Feb 2007, 12:49

Postby Ganius » 27 Nov 2008, 16:41

Hi Lapo.

I've emailed you regarding a support ticket.

Thanks,
G.
falcan
Posts: 44
Joined: 04 Mar 2009, 12:55

Re: _server.loginUser fails

Postby falcan » 25 Mar 2014, 18:09

Very old topic, but I've got exactly this issue...was this ever clarified? Why would error message be null. I don't recall having this issue in my previous project but now with custom java persister its happening, maybe there's a connection?

Basically in the logs I see:

INFO | jvm 1 | 2014/03/24 21:58:26 | 01:58:26.895 - [ INFO ] > Buddy List loaded for user: Burntcicle
INFO | jvm 1 | 2014/03/24 21:58:26 | [ernya_zoneExtension.as]: Ernya login manager: error - null
INFO | jvm 1 | 2014/03/24 21:58:26 | [ernya_zoneExtension.as]: Ernya login manager: error - null
INFO | jvm 1 | 2014/03/24 21:58:30 | 01:58:29.967 - [ FINE ] > User [ java.nio.channels.SocketChannel[closed] ] removed

I'm tryin gto log the error message, that's the "null" part. On the next attemp when they try to login it gets stranger because they appear to be somehow stuck.

INFO | jvm 1 | 2014/03/24 21:58:33 | [ernya_zoneExtension.as]: Remove user: it.gotoandplay.smartfoxserver.data.User@239f85
INFO | jvm 1 | 2014/03/24 21:58:33 | 01:58:33.193 - [ WARNING ] > Exception during client disconnection: java.lang.NullPointerException
INFO | jvm 1 | 2014/03/24 21:58:33 | java.lang.NullPointerException
INFO | jvm 1 | 2014/03/24 21:58:33 | at java.util.concurrent.ConcurrentHashMap.containsKey(ConcurrentHashMap.java:782)
INFO | jvm 1 | 2014/03/24 21:58:33 | at it.gotoandplay.smartfoxserver.EventWriter.isNpc(EventWriter.java:472)
INFO | jvm 1 | 2014/03/24 21:58:33 | at it.gotoandplay.smartfoxserver.EventWriter.handleEvent(EventWriter.java:133)
INFO | jvm 1 | 2014/03/24 21:58:33 | at it.gotoandplay.smartfoxserver.controllers.SystemHandler.sendBuddyListUpdate(SystemHandler.java:3361)
INFO | jvm 1 | 2014/03/24 21:58:33 | at it.gotoandplay.smartfoxserver.data.Zone.removeName(Zone.java:416)
INFO | jvm 1 | 2014/03/24 21:58:33 | at it.gotoandplay.smartfoxserver.SmartFoxServer.lostConnection(SmartFoxServer.java:1545)
INFO | jvm 1 | 2014/03/24 21:58:33 | at it.gotoandplay.smartfoxserver.SmartFoxServer.readIncomingMessages(SmartFoxServer.java:999)
INFO | jvm 1 | 2014/03/24 21:58:33 | at it.gotoandplay.smartfoxserver.EventReader.run(EventReader.java:32)
INFO | jvm 1 | 2014/03/24 21:58:33 | at java.lang.Thread.run(Thread.java:619)
INFO | jvm 1 | 2014/03/24 21:58:33 | 01:58:33.193 - [ FINE ] > User [ Burntcicle ] removed

At the next login attemp this user is claimed to be already logged in ,but isn't found in any rooms and force login can't get him out as well so the user is presented with another login error:null. These problems are "understandable" but I have no idea why the initial login fails. This user logged in before that failed login just fine(I can see him in the logs). Then the user was removed as well (with that "user XXX was removed"), without any Java errors.
User avatar
Lapo
Site Admin
Posts: 23009
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: _server.loginUser fails

Postby Lapo » 25 Mar 2014, 20:12

Yes, 6 year old. I think you could have started a new thread.

Can you show me the code that produce this error?

Code: Select all

INFO | jvm 1 | 2014/03/24 21:58:26 | [ernya_zoneExtension.as]: Ernya login manager: error - null
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 21 guests