powered by Jive Software

XMLPullParser throws Exception

hy there, this is urgent

i have a problem sending smack messages with attached properties. i’'m using smack1.0-beta2.

the following exception is thrown at client2, if i try to send a message with included string-property from client1 to client2…

exception:

‘‘org.xmlpull.v1.XmlPullParserException: parser must be on START_TAG or TEXT to read text (position: START_TAG seen …ttp://www.jivesoftware.com/xmlns/xmpp/properties’’>… @1:1014)

at org.xmlpull.mxp1.MXParser.nextText(MXParser.java:1115)

at org.jivesoftware.smack.PacketReader.parseProperties(PacketReader.java:597)

at org.jivesoftware.smack.PacketReader.parseMessage(PacketReader.java:499)

at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:247)

at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:73)

at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:98)’’

the client can’'t interpret the incoming xml-stream…

‘’<message id=’‘nBR2r6’’ to=’‘client2@web02’’ from=’‘client1@web02/Smack’’>hello client2<x xmlns=’‘http://www.jivesoftware.com/xmlns/xmpp/properties’’>test<value type=’‘string’’>test’’

as far is i can figure out, this xml-stream seems valid, so there must be either a problem in the XMLPullParserimplementation or some bug in the smack PacketReader.class that i wasn’'t able to find…

or i’'m just 2 stupid to do it right - please help

tnxalot

holger,

I’'ll test this scenario out and get back to you.

Thanks,

Matt

hy mike,

any new development in this case?

have you been able to reconstruct the problem?

exception:

‘‘org.xmlpull.v1.XmlPullParserException: parser must be on START_TAG or TEXT to read text (position: START_TAG seen …ttp://www.jivesoftware.com/xmlns/xmpp/properties’’>… @1:1014)

The error message looks suspcious. There’'s a backslash before the ending single quote for the xmlns attribute. Could there be an escaping error somewhere?

to matt,

i’'m so sorry i called you ‘‘mike’’ in my last reply!

must be the lack of sleep, i guess

I’'ve verified that there is an issue and am working on a fix. Thanks for your patience on the issue!

Regards,

Matt

The issue is now fixed for beta 3.

Regards,

Matt

it was a pleasure…

Could you explain briefly where the problem stemmed from? I was able to recreate the same error yesterday, but waking up this morning I seem to have lost the ability to crash the application. lol.

Also, it’‘s probably somewhere on this site, but what’'s the ETA for the release of beta 3?

Cheers

ribot.

ribot,

I believe that trying to read properties attached to packets was basically entirely broken. It was due to a bit of faulty XML parsing logic.

There’'s no ETA on beta 3 quite, yet, although it will likely be out soon, since there are many important changes. One good way to track progress is to look at the list of open vs. fixed issues in the issue tracker.

Regards,

Matt