Better handling of Roster error

Description

If there is an error in the server side by adding a new contact, Smack raises an exception that makes Spark goes down.

java.lang.NullPointerException: Name is null
at java.lang.Enum.valueOf(Unknown Source)
at org.jivesoftware.smack.packet.RosterPacket$ItemType.valueOf(RosterPacket.java:268)
at org.jivesoftware.smack.PacketReader.parseRoster(PacketReader.java:697)
at org.jivesoftware.smack.PacketReader.parseIQ(PacketReader.java:582)
at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:275)
at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:44)
at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:76)

These are the stanzas that cause the error:
Openfire RCV: <iq id="3Rqm2-48" type="set" from="95c7a9c5@server1/95c7a9c5"><query xmlns="jabber:iq:roster"><item jid="tsung1@server2"
name="tsung1"><group>Friends</group></item></query></iq>
Openfire SENT: <iq type="error" id="3Rqm2-48" to="95c7a9c5@server1/95c7a9c5"><query xmlns="jabber:iq:roster"><item jid="tsung1@server2"
name="tsung1"><group>Friends</group></item></query><error code="500" type="wait"><internal-server-error xmlns="urn:ietf
:params:xml:ns:xmpp-stanzas"/></error></iq>

Environment

None

Activity

Show:
Guenther Niess
February 24, 2010, 7:16 AM

Is already fixed on revision 11642.

Guenther Niess
February 24, 2010, 6:43 AM

I suppose this should be related to and fixed in the current trunk version. Sorry for duplicating this bug :-/ Please verify this and comment on this issue.

Kir Maximov
July 9, 2009, 1:12 PM

TeamCity project suffers from this problem as well: http://www.jetbrains.net/tracker/issue2/TW-6100

yoav zibin
December 25, 2007, 5:20 PM

No, the same problem still happens.
I couldn't find the oficial release of 3.0.5, so I downloaded the SVN:
http://svn.igniterealtime.org/svn/repos/smack/trunk
And used ANT to build everything.
I still get:

java.lang.NullPointerException: Name is null
at java.lang.Enum.valueOf(Enum.java:191)
at org.jivesoftware.smack.packet.RosterPacket$ItemType.valueOf(RosterPacket.java:268)
at org.jivesoftware.smack.PacketReader.parseRoster(PacketReader.java:697)
at org.jivesoftware.smack.PacketReader.parseIQ(PacketReader.java:582)
at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:275)
at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:44)
at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:76)

And I connect to GTalk, so I assume the bug is in SMACK....

yoav zibin
July 30, 2007, 9:31 PM

I just wanted to note that I get this exception when connecting to GoogleTalk:
new ConnectionConfiguration("talk.google.com", 5222, "gmail.com");

Assuming GoogleTalk adheres to the spec, then the bug must be in SMACK.
Instead of disconnecting, SMACK should give a callback to the user who can write a custom error handling routine.

Fixed
Your pinned fields
Click on the next to a field label to start pinning.

Assignee

MattM

Reporter

Francisco Vives