powered by Jive Software

Strange "stream:error (text)"

Hi.

I saw another case containing the below error but I am quite confident that I am only logged in once and in one thread with the user credentials.

We have built an integration with the wordpress.com im service to be able to subscribe to feeds of interest.

The below arrives in the log about 10 sec after the “Hello there” statement.

2009-10-26 15:36:16.413 INFO com.tailsweep.crawling.xmpp.WordpressPubSub - Chat created with bot@im.wordpress.com
2009-10-26 15:36:16.759 INFO com.tailsweep.crawling.xmpp.WordpressPubSub - Bot says: Hello there! Can I help you?
stream:error (text)
at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:306)
at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:44)
at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:76)

I add the interesting code below:

public void init()
{
try
{
ConnectionConfiguration config = new ConnectionConfiguration(“im.wordpress.com”, 5222);
conn = new XMPPConnection(config);
conn.connect();
conn.login(“user”, “pwd”);

setupChatListener();
createBotChat();

Roster roster = conn.getRoster();
roster.setSubscriptionMode(Roster.SubscriptionMode.accept_all);
}
catch (XMPPException e)
{
log.error(e.toString(), e);
}
}

private void createBotChat() throws XMPPException
{
Chat newChat = conn.getChatManager().createChat("bot@im.wordpress.com", new MessageListener()
{
public void processMessage(Chat chat, Message message)
{
log.info("Bot says: " + message.getBody());
}
});
newChat.sendMessage(“hi”);
}

private void setupChatListener()
{
ChatManager chatmanager = conn.getChatManager();
chatmanager.addChatListener(new ChatManagerListener()
{
public void chatCreated(Chat chat, boolean b)
{
log.info("Chat created with “+chat.getParticipant());
if(!chat.getParticipant().startsWith("bot@im.wordpress.com”))
{
chat.addMessageListener(new MessageListener()
{
public void processMessage(Chat chat, Message message)
{
//Removed business code for clarity
}
});
}
}
});
}

Any clues ?

BYTW nice library, really straight forward.

Cheers

//Marcus Herou

I commented away these two statements:

//setupChatListener();
//createBotChat();

Still same issue…

I looked in your source code at the suspicious row but it was hard to understand what the error was… Some error with xmlpull parser ? Came to think of something… What version of the parser should I use ?

Cheers

//Marcus

We use xpp3 1.1.4c it seems.

However we have xfire, xstream and more. Can it become any conflict ?

The problem is stream:error (text) is a very general error, it’s actually a bug in the Smack library in how it parses stream:error tags

see http://www.igniterealtime.org/community/thread/39110

So stream:error can be a number of different errors (http://www.ietf.org/rfc/rfc3920.txt Section 4.7.3); to determine what, you need the actual error code, and the content of the text tag.

You can either recompile Smack with the attached patch in the above mentioned thread, or just run the Smack debugger and find the full stream error in the raw packets (http://www.igniterealtime.org/builds/smack/docs/latest/documentation/debugging.h tml)

HTH

Dan