powered by Jive Software

Smack-4.1.0-alpha4 Some bugs in MUC module

I am implementing a xmpp client on Android, here is some issue I’ve noticed in MUC module

  1. org.jivesoftware.smackx.muc.packet.MUCItem.toXML()

It doesn’t check when ‘role’ is null. So when I tried to add a user to owner list, my app crashed.

  1. org/jivesoftware/smackx/muc/MultiUserChatManager.getMultiUserChat()

It doesn’t check null for multiUserChats.get(jid), which causes a NPE.

Hope this get fixed ASAP.

Thanks for reporting.

  1. fixed with Fix NPE in MUCItem if role is null · 5d963f7 · Flowdalic/Smack · GitHub

  2. fixed with Fix NPE in MultiUserChatManager.getMultiUserchat() · 47e327f · Flowdalic/Smack · GitHub

1 Like

Thanks for quick fix

Again, I’ve had a exception in MultiUserChatManager, here’s the log.

10-21 08:24:22.382 29951-31198/xx.yyyy E/AbstractXMPPConnection﹕ Exception in packet listener

java.lang.ClassCastException: org.jivesoftware.smack.packet.Presence cannot be cast to org.jivesoftware.smack.packet.Message

at org.jivesoftware.smackx.muc.MultiUserChatManager$2.processPacket(MultiUserChatM anager.java:124)

at org.jivesoftware.smack.AbstractXMPPConnection.notifiyReceivedListeners(Abstract XMPPConnection.java:854)

at org.jivesoftware.smack.AbstractXMPPConnection$ListenerNotification.run(Abstract XMPPConnection.java:876)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:390)

at java.util.concurrent.FutureTask.run(FutureTask.java:234)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201 (ScheduledThreadPoolExecutor.java:153)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Schedu ledThreadPoolExecutor.java:267)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)

at java.lang.Thread.run(Thread.java:856)

10-21 08:24:22.382 29951-31198/xx.yyyy E/AbstractXMPPConnection﹕ Exception in packet listener

java.lang.ClassCastException: org.jivesoftware.smack.packet.Presence cannot be cast to org.jivesoftware.smack.packet.Message

at org.jivesoftware.smackx.muc.MultiUserChatManager$2.processPacket(MultiUserChatM anager.java:124)

at org.jivesoftware.smack.AbstractXMPPConnection.notifiyReceivedListeners(Abstract XMPPConnection.java:854)

at org.jivesoftware.smack.AbstractXMPPConnection$ListenerNotification.run(Abstract XMPPConnection.java:876)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:390)

at java.util.concurrent.FutureTask.run(FutureTask.java:234)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201 (ScheduledThreadPoolExecutor.java:153)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Schedu ledThreadPoolExecutor.java:267)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)

at java.lang.Thread.run(Thread.java:856)

When I looked at the method private MultiUserChatManager(XMPPConnection connection), I noticed that invitationFilter let the Presence packet to get through, and that’s why it through the above exception in this line:

Message message = (Message) packet;

Is it a bug or I missed something?

Again, I’ve had a exception in MultiUserChatManager, here’s the log.
Thanks for reporting, Should be fixed with https://github.com/Flowdalic/Smack/commit/6a2bc0c02d8407986b0520e60145947425a6b2 e7

1 Like