in chatterbox-xmpp/chatterbox-xmpp-impl/src/main/java/org/apache/tomee/chatterbox/xmpp/impl/XMPPResourceAdapter.java [255:280]
public void connect() {
ConnectionConfiguration connConfig = new ConnectionConfiguration(host, port, serviceName);
connection = new XMPPTCPConnection(connConfig);
try {
connection.connect();
LOGGER.finest("Connected to " + host + ":" + port + "/" + serviceName);
} catch (XMPPException | SmackException | IOException e) {
LOGGER.log(Level.SEVERE, "Unable to connect to " + host + ":" + port + "/" + serviceName, e);
}
try {
connection.login(username, password);
LOGGER.finest("Logged in as " + username);
Presence presence = new Presence(Presence.Type.available);
connection.sendPacket(presence);
} catch (XMPPException | SmackException | IOException e) {
LOGGER.log(Level.SEVERE, "Unable to login as " + username, e);
}
connected = true;
chatmanager = ChatManager.getInstanceFor(connection);
chatmanager.addChatListener(this);
}