powered by Jive Software

Cannot send message between openfire et smack


I am trying to send a message between the user sender1 et the user listener 1, I have tried to follow the documentation and creating this code:


ConnectionConfiguration config2 = new ConnectionConfiguration(“”, 5222);
// Create a connection to the igniterealtime.org XMPP server.
XMPPConnection con = new XMPPConnection(config2);
// Connect to the server


// Most servers require you to login before performing other tasks.
con.login(“sender1”, “a”);

// Start a new conversation with John Doe and send him a message.
Chat chat = con.getChatManager().createChat(“listener1”, new org.jivesoftware.smack.MessageListener() {

             public void processMessage(Chat chat, Message message) {
                 // Print out any messages we get back to standard out.
                 System.out.println("Received message: " + message);


// Disconnect from the server

catch(Exception e)
System.out.println("error : " + e.toString());

The connection on openfire is good but my message is never displayed and I have no errors.

Can someone tell me what I have done wrong?

Thank you very much.