Feature not implemented (501)

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.

I noticed the following entries in the smack.properties file

<!-- Offline Message Requests -->

<iqProvider>

<elementName>offline</elementName>

    &lt;namespace&gt;http://jabber.org/protocol/offline</namespace>

<className>org.jivesoftware.smackx.packet.OfflineMessageRequest$Provider& lt;/className>

</iqProvider>

<!-- Offline Message Indicator -->

<extensionProvider>

<elementName>offline</elementName>

    &lt;namespace&gt;http://jabber.org/protocol/offline</namespace>

<className>org.jivesoftware.smackx.packet.OfflineMessageInfo$Provider< /className>

</extensionProvider>

Is something wrong with this? I keep getting the Feature not implemented (501) error.

Do I need to change anything in the smack.properties file?

Any suggestions will be greatly appreciated. I’m at my wits end.

Thanks,

Neha.

My guess is, this is not a problem of smack per se, but the server is telling you “I don’t do this thing you are asking”. The thing being flexible retrieval apparently. Maybe there is a different way to get the messages?

Edit: Put the “is supported” test in a try-catch block, at least then your application can continue.

Its a Jabberd2 server. Is there any other way of obtaining the offline messages?

Thanks,

Neha.

Hi,

Any can tell me solution of above mention issue, i am also facing the same type of problem.

So please help me in this area as quick as possible.

Thanks,

Sumeet Guha.

tried this ?

yes, that is working at my hand also… now i am also out of that problem in my project.

thank you for replying.