I am using Jabberd2 as the XMPP Server and using smack 3.0.4 to connect to the server and obtain offline messages information. This is the piece of code I am using
ConnectionConfiguration config = new ConnectionConfiguration(server, port, service);
config.setSASLAuthenticationEnabled(false);
xmppConn = new XMPPConnection(config);
xmppConn.connect();
xmppConn.login(username, password);
OfflineMessageManager mgr = new OfflineMessageManager(xmppConn);
if(mgr.supportsFlexibleRetrieval())
{
Iterator<Message> it = mgr.getMessages();
while(it.hasNext())
{
System.out.println("— " + ((Message)it.next()).getBody());
}
}
I get the following error
feature-not-implemented(501)
at org.jivesoftware.smackx.ServiceDiscoveryManager.discoverInfo(ServiceDiscoveryMa nager.java:413)
at org.jivesoftware.smackx.ServiceDiscoveryManager.discoverInfo(ServiceDiscoveryMa nager.java:379)
at org.jivesoftware.smackx.OfflineMessageManager.supportsFlexibleRetrieval(Offline MessageManager.java:80)
at com.temp.Jabberd2MsgManager.getOfflineMsg(Jabberd2MsgManager.java:109)
at com.temp.JabberClientTester.main(JabberClientTester.java:24)
Line 109 in the above piece of code is
if(mgr.supportsFlexibleRetrieval())
Any idea as to what I may be doing wrong? Please suggest.
Thanks,
Neha.