0
votes

I am trying to create a XMPP chat client using aSmack library for android.I am using openfire server that runs on localhost. I am creating a XMPPConnection and logging in the user successfully but when I try to create a new roster entry for that connection it throws an internal server error

Presence presence = new Presence(Presence.Type.subscribe);
            presence.setTo(requestedUser);
            connection.sendPacket(presence);

            try {
                roster.createEntry(requestedUser+"@123", "nickname", null);

            } catch (XMPPException e) {
                Log.e("exception", e.getMessage().toString());
            }

Through this piece of code I am trying to send a friend request to another user.

1
Can you add some more information like the complete LogCat output and how you retrieved your roster?Marc Van Daele

1 Answers

-1
votes

When you call roster.createEntry(), it will send request to your openfire server,and then the server will insert an new record into your ofRoster table in openfire database. So insure that ofRoster table exists.