AvatarManager throws StanzaException due to <item-not-found>

Issue #21 closed
Markus KARG created an issue

Tried to receive an avatar, but got another stack trace :-(

IN : <presence from="headcrashing@jabber.de/standalone"><priority>10</priority><c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="http://xmpp.rocks"
ver="sOPln8pAyLKewaaJAhBHIJTPIVE="></c></presence>
OUT: <message to="mkarg@jabber.de" type="chat"><thread>549db665-cf61-4334-a39a-cf025daec618</thread><gone xmlns="http://jabber.org/protocol/chatstates"></gone><
/message>
IN : <presence from="headcrashing@jabber.de/standalone"><priority>10</priority><c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="http://xmpp.rocks"
ver="YhsriNHd0WY9WvfFv1FIeNd6Elw="></c><x xmlns="vcard-temp:x:update"></x></presence>
OUT: <iq from="headcrashing@jabber.de/standalone" id="disco" to="headcrashing@jabber.de" type="result"><query xmlns="http://jabber.org/protocol/disco#info"><ide
ntity category="client" type="pc"></identity><feature var="http://jabber.org/protocol/bytestreams"></feature><feature var="http://jabber.org/protocol/caps"></fe
ature><feature var="http://jabber.org/protocol/chatstates"></feature><feature var="http://jabber.org/protocol/disco#info"></feature><feature var="http://jabber.
org/protocol/disco#items"></feature><feature var="http://jabber.org/protocol/ibb"></feature><feature var="http://jabber.org/protocol/rsm"></feature><feature var
="http://jabber.org/protocol/si"></feature><feature var="http://jabber.org/protocol/si/profile/file-transfer"></feature><feature var="jabber:iq:last"></feature>
<feature var="jabber:iq:oob"></feature><feature var="jabber:iq:version"></feature><feature var="jabber:x:oob"></feature><feature var="jid\20escaping"></feature>
<feature var="urn:xmpp:avatar:metadata"></feature><feature var="urn:xmpp:avatar:metadata+notify"></feature><feature var="urn:xmpp:hash-function-text-names:md5">
</feature><feature var="urn:xmpp:hash-function-text-names:sha-1"></feature><feature var="urn:xmpp:hash-function-text-names:sha-224"></feature><feature var="urn:
xmpp:hash-function-text-names:sha-256"></feature><feature var="urn:xmpp:hash-function-text-names:sha-384"></feature><feature var="urn:xmpp:hash-function-text-na
mes:sha-512"></feature><feature var="urn:xmpp:hashes:1"></feature><feature var="urn:xmpp:ping"></feature><feature var="urn:xmpp:time"></feature><feature var="vc
ard-temp"></feature></query></iq>
IN : <iq id="053f4962-54e6-4bcc-8329-297e2026d619" to="headcrashing@jabber.de/standalone" type="error"><error type="cancel"><item-not-found xmlns="urn:ietf:para
ms:xml:ns:xmpp-stanzas"></item-not-found></error></iq>
Feb 15, 2015 9:28:02 AM rocks.xmpp.extensions.avatar.AvatarManager$2 run
WARNUNG: <item-not-found/>  -  (type 'cancel': do not retry (the error cannot be remedied))
rocks.xmpp.core.stanza.StanzaException: <item-not-found/>  -  (type 'cancel': do not retry (the error cannot be remedied))
        at rocks.xmpp.core.session.XmppSession.query(XmppSession.java:563)
        at rocks.xmpp.core.session.XmppSession.query(XmppSession.java:506)
        at rocks.xmpp.extensions.vcard.temp.VCardManager.getVCard(VCardManager.java:61)
        at rocks.xmpp.extensions.avatar.AvatarManager.getAvatarByVCard(AvatarManager.java:184)
        at rocks.xmpp.extensions.avatar.AvatarManager.access$000(AvatarManager.java:83)
        at rocks.xmpp.extensions.avatar.AvatarManager$2.run(AvatarManager.java:496)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

Comments (4)

  1. Christian Schudt repo owner

    Don't throw exception on stanza error while trying to retrieve vCard based avatars.

    If a user has no vCard, he also can't have an avatar. Therefore proceed as normal as if the <PHOTO> element of the vCard were empty.

    If retrieving vCard threw another exception (most likely only NoResponseException), log it less verbosely (without stacktrace) and with better message text.

    Fixes Issue #21.

    → <<cset 4e919600cd82>>

  2. Log in to comment