NullPointerException (AsyncSocketServlet:54 < ...)

Tracker 3 years ago

Does anyone know what could cause a /api/socket - NullPointerException (AsyncSocketServlet:54 < ...) error?
I use Teltonika devices and get the error quite frequently but cannot really see any issues when looking at devices in the web app.

Anton Tananaev 3 years ago

I think the error indicates that you don't have a session.

Tracker 3 years ago

Thanks Anton, do you know what might be causing it?
It seems to appear in the log file every minute.

Anton Tananaev 3 years ago

It means someone left web app and it keeps trying to reconnect every minute.

mbodea2007 3 years ago

Hi, I'm seeing this too:

 WARN: /api/socket - Cannot invoke "java.lang.Long.longValue()" because the return value of "javax.servlet.http.HttpSession.getAttribute(String)" is null - NullPointerException (AsyncSocketServlet:54 < ...)

Is there a fix?
Thx.

Anton Tananaev 3 years ago

Why do you need to fix it?

mbodea2007 3 years ago

i'ts just a warning indeed, should we leave it as it is ?
with lots of mobile app users, wouldn't this fill the log?
Thx

Anton Tananaev 3 years ago

It shouldn't happen more than once per session, so shouldn't be a problem.