Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
javanesevn #1
Member since Apr 2008 · 74 posts · Location: Japan
Group memberships: Members
Show profile · Link to this post
Subject: agsXMPP.Xml.xpnet.InvalidTokenException
Hello Alex,

When I received below message from other client, the agsXMPP library is broken in parser process. I can not get any log error for debugging.
The lib forced OnStreamError in agsXMPP.Xml.StreamParser at line 211. Please confirm it.

RECV:
  <message xmlns="jabber:client" from="test4@xmpp01" to="test@xmpp01/home" id="test4@xmpp01__test@xmpp01__KjHmR">
        <event xmlns="http://jabber.org/protocol/pubsub#event">
             <items node="http://jabber.org/protocol/tune">
                  <item id="C4cHNeauEi5i5Q7"><tune xmlns="http://jabber.org/protocol/tune" /></item>
             </items>
        </event>
        <x xmlns="jabber:x:delay" stamp="2009-04-21T09:13:05.695Z" />
        <addresses xmlns="http://jabber.org/protocol/address">
               <address type="replyto" jid="test4@xmpp01/204a8a09" />
        </addresses>
</message>


Best regards,
Avatar
Alex #2
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
I sent this message to the MiniClient without any problems.
Maybe there is an unhandled error in your code which closes the connection, or the error is coming from another stanza.
Can you try to sniff the traffic with a network sniffer? You must connect without TLS or SSL then.

Alex
Avatar
javanesevn #3
Member since Apr 2008 · 74 posts · Location: Japan
Group memberships: Members
Show profile · Link to this post
Thank you Alex.

I do sniffer but it did not expose useful info for me except report about XML is not recognized.
And it only show content under uft8 character map and binary format.

Sorry, from my previous post, the message has no problem in parser.
In Encoding code, at byteType(buf, off) process it return value 10 and its not match to any case so this exception InvalidTokenException(off)  is called.

In my code when Presence event incoming I changed status for RosterItem and request DiscoInfo for each of item.
If I commented out Disco request, the error has not been raised.
But the code work very well until I used other client to login to server. I also tried Psi and Spark, both can login to server.

How can I debug exactly this issue?

Best,
Avatar
Alex #4
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
it looks like you receive invalid XML characters.

Quote by javanesevn on 2009-05-02, 01:48:
1241221701

what is the value of buf? Which function in the parser code raises the exeption?

Alex
Avatar
javanesevn #5
Member since Apr 2008 · 74 posts · Location: Japan
Group memberships: Members
Show profile · Link to this post
Sorry, I got busy for other task and I can not response you as soon.

Now previous data is deleted out of my DB so I couldn't know what data in buf? Really sorry.
If I got this problem again I will report to you.

Best regards,
Avatar
GuotaoWang #6
User title: GuotaoWang
Member since Apr 2010 · 3 posts
Group memberships: Members
Show profile · Link to this post
In reply to post #2
Subject: agsXMPP.Xml.xpnet.InvalidTokenException
Hello
  I am a chinese student, i have a question about agsXMPP,when i run the appcation ,i have a deug about agsXMPP.Xml.xpnet.InvalidTokenException, i just lean agsXMPP a few days, so i have no idea about it , could you help me find out the problem about this. i have MSN,if you have times ,we can talk in MSN. wish repaly back soon!
Best Wish!
Avatar
GuotaoWang #7
User title: GuotaoWang
Member since Apr 2010 · 3 posts
Group memberships: Members
Show profile · Link to this post
Subject: forget...
sorry i forget something ,my MSN is wang_guo_tao@live.cn
Avatar
Alex #8
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
try to catch the XML which passes the wire from the ClientSocket OnRead and OnWrite handlers (Socket Debug in MiniClient). They get raised before the XML gets processed by the XML parser.
I assume that you receive invalid XML which raises this exception.

Alex
Avatar
GuotaoWang #9
User title: GuotaoWang
Member since Apr 2010 · 3 posts
Group memberships: Members
Show profile · Link to this post
Subject: Thanks
Thanks Alex , my appcation was complined by Visual Studio 2005,when i run in Visual Studio 2008,that exception was arised. Is because XML ?
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: agsXMPP RSS