MessageEventManager Exception

not quite sure what’'s causing this exception:

java.lang.NoSuchMethodException: org.jivesoftware.smackx.MessageEventRequestListener.cancelledNotificationRequested(java.lang.String, java.lang.String, org.jivesoftware.smackx.MessageEventManager)
        at java.lang.Class.getDeclaredMethod(Class.java:1264)
        at org.jivesoftware.smackx.MessageEventManager.fireMessageEventRequestListeners(MessageEventManager.java:148)
        at org.jivesoftware.smackx.MessageEventManager.access$000(MessageEventManager.java:39)
        at org.jivesoftware.smackx.MessageEventManager$1.processPacket(MessageEventManager.java:205)
        at org.jivesoftware.smack.PacketReader$ListenerWrapper.notifyListener(PacketReader.java:823)
        at org.jivesoftware.smack.PacketReader.processListeners(PacketReader.java:227)
        at org.jivesoftware.smack.PacketReader.access$100(PacketReader.java:45)
        at org.jivesoftware.smack.PacketReader$2.run(PacketReader.java:79)

Here are the packets that cause the exception. Sent from gaim.

I start typing a message in the gaim window, and then erase everything I typed.

<message type=''chat'' to=''synic@jbother.org/work'' from=''testuser@jbother.org/Gaim''><x xmlns=''jabber:x:event''><composing/></x></message>
<message type=''chat'' to=''synic@jbother.org/work'' from=''testuser@jbother.org/Gaim''><x xmlns=''jabber:x:event''/></message>

Hey Adam,

Thanks for the bug report. It seems that I missed the #cancelledNotificationRequested method in MessageEventRequestListener. I’'ll add it ASAP. Issue number: SMACK-46

Thanks,

– Gato

Hey Adam,

The Smack implementation is fine. Canceling events can only be sent as part of a notification not a request. The problem with this packet is that it is requesting to be informed of a cancellation. You can only inform of cancellations. So you need to add the id of the packet that is being canceled.

<message type=''chat'' to=''synic@jbother.org/work'' from=''testuser@jbother.org/Gaim''><x xmlns=''jabber:x:event''/></message>

FYI, when no events are being specified it means that it is a cancellation.

If you are ok, I’'m closing the issue.

Thanks,

– Gato

Ok - so it’'s a gaim protocol bug?

I thought that you were sending those packets manually. If those packets were sent by Gaim when you started to write and then canceled the message then it’'s a Gaim error.

Gaim should be sending in both packets the id of the message for which you are writing and then canceling a reply. Without the id element the interpretation of those packets is that the client is requesting event notifications.

For more information you can follow this link: http://www.jabber.org/jeps/jep-0022.html

Regards,

– Gato

Can you turn off the stacktrace for this in the exception handling, or at least change getDeclaredMethod to getMethod so I can stub out a method for this?

Thanks,

Rob

Hey Rob,

I don’'t see how using getMethod instead of getDeclaredMethod will be of help in this case. Since we are sending getDeclaredMethod to the MessageEventRequestListener and MessageEventNotificationListener classes there is no chance for you to provide the missing method in a subclass. Am I missing something?

Since this is an exception I think that we need to keep track of the problem. Could you redirect the stderr to a file? Maybe that could be of help.

Regards,

– Gato