Giter VIP home page Giter VIP logo

Comments (15)

GoogleCodeExporter avatar GoogleCodeExporter commented on September 18, 2024
The sysout is caused by
http://github.com/rtreffer/smack/blob/master/source/org/jivesoftware/smackx/pack
et/VCard.java#L540

You ran into a ClassCastException on
result = (VCard) 
collector.nextResult(SmackConfiguration.getPacketReplyTimeout());

This means that the collector received an response but couldn't build a 
package. A
common symptom for a missing PacketExtension. "vCard" in the "vcard-temp" 
namespace
has to be associated with a vCard-parser.

https://svn.igniterealtime.org/svn/repos/smack/trunk/build/resources/META-INF/sm
ack.providers
    <iqProvider>
        <elementName>vCard</elementName>
        <namespace>vcard-temp</namespace>
        <className>org.jivesoftware.smackx.provider.VCardProvider</className> 
    </iqProvider>

In code:
ProviderManager.getInstance().addIQProvider("vCard", "vcard-temp", new
org.jivesoftware.smackx.provider.VCardProvider());

Have fun!

Original comment by [email protected] on 11 May 2010 at 10:46

  • Changed state: Done

from asmack.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 18, 2024
Set do DONE because I think it's that problem. please reopen and provide more
information if I'm wrong.

Original comment by [email protected] on 12 May 2010 at 6:42

from asmack.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 18, 2024
Thank you, that solved the issue :)
I think that this suggestion should be added to the javadoc of the VCard class.
Bye!

Original comment by [email protected] on 12 May 2010 at 8:47

from asmack.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 18, 2024
Please help me, i have the same issue, but inserting line

ProviderManager.getInstance().addIQProvider("vCard", "vcard-temp", new  
org.jivesoftware.smackx.provider.VCardProvider());

nothing changes. Where should I put this string,before connection.connnect() or 
just before vCard.load(connection) ???
thanks in advance!

Original comment by [email protected] on 19 Sep 2010 at 1:37

from asmack.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 18, 2024
Im unable to get Friends profile picture using this.. can anyone please list 
out the steps what to do ?

I am getting same error as was mentioned above.

Original comment by [email protected] on 27 Dec 2010 at 1:26

from asmack.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 18, 2024
I met the same issue which was resolved by adding the VCardProvider. Thank you 
rtreffer!

Original comment by [email protected] on 3 Mar 2011 at 1:41

from asmack.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 18, 2024
When I call vcard.getAvatar, the resulting array is not a picture of the array. 
How to get friends pictures? Please help,Thanks.

Original comment by [email protected] on 17 May 2011 at 8:05

from asmack.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 18, 2024
[deleted comment]

from asmack.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 18, 2024
@[email protected] Thanks a lot.

It works pretty well when I added

ProviderManager.getInstance().addIQProvider("vCard", "vcard-temp", new
org.jivesoftware.smackx.provider.VCardProvider());

before

vcard.load(this.connection, user);

Original comment by [email protected] on 15 Dec 2011 at 7:57

from asmack.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 18, 2024
I used the code 
ProviderManager.getInstance().addIQProvider("vCard", "vcard-temp", new
org.jivesoftware.smackx.provider.VCardProvider());

but it still doesn't work, any help?

Original comment by [email protected] on 30 May 2013 at 10:47

from asmack.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 18, 2024
[deleted comment]

from asmack.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 18, 2024
Adding the IQProvider DOESN'T work for me too.
ProviderManager.getInstance().addIQProvider("vCard", "vcard-temp", new
org.jivesoftware.smackx.provider.VCardProvider());

I'm getting this in logcat:
SENT (1102292544): <iq id="2hh9b-8" from="[email protected]/Smack" 
type="get"><vCard xmlns='vcard-temp'/></iq>

RCV  (1102292544): <iq id='2hh9b-8' type='error' 
to='[email protected]/Smack'><error type='cancel'><item-not-found 
xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/></error></iq>

I/System.out(14075): No VCard for [email protected]/Smack

E/AndroidRuntime(14075): java.lang.NullPointerException: expected receiver of 
type org.jivesoftware.smackx.packet.VCard, but got null

Original comment by [email protected] on 5 Aug 2013 at 12:32

from asmack.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 18, 2024
Hi I am using 'asmack:asmack:8-4.0.2' and while loading the vcard with null 
Avatar it crashes the App with following error 
 java.lang.ClassCastException: org.jivesoftware.smack.util.PacketParserUtils$2 cannot be cast to org.jivesoftware.smackx.vcardtemp.packet.VCard
            at org.jivesoftware.smackx.vcardtemp.packet.VCard.doLoad(VCard.java:560)
            at org.jivesoftware.smackx.vcardtemp.packet.VCard.load(VCard.java:542)

Although the same App with no changes in it works fine when Avatar is set to 
something.
Don't know how to fix above solution doesn't work.
Thanks


Original comment by [email protected] on 9 Oct 2014 at 5:12

from asmack.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 18, 2024
any one with a solution for this : 
 java.lang.ClassCastException: org.jivesoftware.smack.util.PacketParserUtils$2 cannot be cast to org.jivesoftware.smackx.vcardtemp.packet.VCard
            at org.jivesoftware.smackx.vcardtemp.packet.VCard.doLoad(VCard.java:560)
            at org.jivesoftware.smackx.vcardtemp.packet.VCard.load(VCard.java:542)

Original comment by [email protected] on 7 Nov 2014 at 7:23

from asmack.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 18, 2024
I just Got it worked when i changed my code here

ProviderManager.getInstance().addIQProvider("vCard", "vcard-temp", new 
VCardProvider()); to ProviderManager.getInstance().addIQProvider("vCard", 
"vcard-temp:x:update", new VCardProvider());

Original comment by [email protected] on 9 Feb 2015 at 6:52

from asmack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.