powered by Jive Software

Login without resource specified: funny behavior

I’'m new around here, not sure if this is a question or a bug.

In a custom Jabber client I’'m writing to do automated stuff, I was logging in without specifying a resource to a plain vanilla config of Jive Messenger 2.1.2. The server let me login, but I saw some funny behavior:

  1. in the admin console, the session showed up, but when I clicked on it for detail, it gave me a stack trace (see below)

  2. if i disconnected properly by broadcasting presence unavailable and sending </stream:stream>, or even if I ctrl-c killed my client, it did not remove the session, instead I got a stack trace in the server’'s error log. (see below)

  3. in the admin console, disconnecting the session says that it succeeded, but it really failed and did not remove the session. Therefore, I have to reboot the server to clear out this session.

I found that Exodus and Psi require you to specify a resource in your identifier, so this problem can probably only happen when you’‘re directly coding a Jabber client (like me). But it took me a heck of a time to figure out my simple mistake. If the server can’‘t support missing resource, I’'d recommend that it just reject the login in the first place.

So, I have a workaround (specify the resource! :-). However, I don’'t like it that an errant Jabber client can put the server in a bad state. Otherwise, great product so far!

Stack Trace #1:

java.lang.NullPointerException

at org.jivesoftware.messenger.admin.session_002ddetails_jsp._jspService(session_00 2ddetails_jsp.java:234)

at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)

at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427)

at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplica tionHandler.java:816)

at org.jivesoftware.util.LocaleFilter.doFilter(LocaleFilter.java:45)

at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplica tionHandler.java:807)

at org.jivesoftware.util.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingF ilter.java:41)

at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplica tionHandler.java:807)

at org.jivesoftware.admin.AuthCheckFilter.doFilter(AuthCheckFilter.java:76)

at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplica tionHandler.java:807)

at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler. java:488)

at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:569)

at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)

at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.ja va:624)

at org.mortbay.http.HttpContext.handle(HttpContext.java:1434)

at org.mortbay.http.HttpServer.service(HttpServer.java:896)

at org.mortbay.http.HttpConnection.service(HttpConnection.java:814)

at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:981)

at org.mortbay.http.HttpConnection.handle(HttpConnection.java:831)

at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)

at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:366)

at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)

Stack Trace #2:

2005.04.06 09:24:19 [org.jivesoftware.messenger.handler.IQAuthHandler.login(IQAuthHandler.java:175)

] Error during login

java.lang.NullPointerException

at org.jivesoftware.messenger.handler.IQAuthHandler.login(IQAuthHandler.java:161)

at org.jivesoftware.messenger.handler.IQAuthHandler.handleIQ(IQAuthHandler.java:12 3)

at org.jivesoftware.messenger.handler.IQHandler.process(IQHandler.java:48)

at org.jivesoftware.messenger.IQRouter.handle(IQRouter.java:195)

at org.jivesoftware.messenger.IQRouter.route(IQRouter.java:74)

at org.jivesoftware.messenger.PacketRouter.route(PacketRouter.java:65)

at org.jivesoftware.messenger.net.SocketReadThread.readStream(SocketReadThread.jav a:254)

at org.jivesoftware.messenger.net.SocketReadThread.run(SocketReadThread.java:110)

Message was edited by:

csimms

csimms,

Many thanks for the bug report. We’‘ll get this fixed for the next release and I’'ve filed the issue as JM-243.

Regards,

Matt

Hey csimms,

The problem has been fixed. Now Messenger will answer an error if no resource is supplied during login. You can download tomorrow’'s nightly build which will include the bug fix.

Thanks,

– Gato

Thanks for the fast response! I confirmed your fix works in version 2.1.3.