powered by Jive Software

Can't Login To Openfire from Smack

Hi, Few Weeks back i was able to login to my openfire server and now im not able to connect with my same java code
the Error im facing is…

W/System.err( 1009): org.jivesoftware.smack.SmackException$ConnectionException: The following addresses failed
W/System.err( 1009): at org.jivesoftware.smack.tcp.XMPPTCPConnection.connectUsingConfiguration(XMPPTCPConnection.java:668)
W/System.err( 1009): at org.jivesoftware.smack.tcp.XMPPTCPConnection.connectInternal(XMPPTCPConnection.java:971)
W/System.err( 1009): at org.jivesoftware.smack.AbstractXMPPConnection.connect(AbstractXMPPConnection.java:435)
W/System.err( 1009): at com.grevity.oyindori.MyXMPP$2.doInBackground(MyXMPP.java:79)
W/System.err( 1009): at com.grevity.oyindori.MyXMPP$2.doInBackground(MyXMPP.java:75)
W/System.err( 1009): at android.os.AsyncTask$3.call(AsyncTask.java:378)
W/System.err( 1009): at java.util.concurrent.FutureTask.run(FutureTask.java:266)
W/System.err( 1009): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:289)
W/System.err( 1009): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
W/System.err( 1009): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
W/System.err( 1009): at java.lang.Thread.run(Thread.java:919)

and my java code is

    private static final String DOMAIN = "team-grevity.in";
    private static final String HOST = "team-grevity.in";
    private static final int PORT = 5222;
    private String userName = "";
    private String passWord = "";
    org.jivesoftware.smack.chat.ChatManager chatManager;
    AbstractXMPPConnection connection;
    XMPPConnectionListener connectionListener = new XMPPConnectionListener();
    private boolean connected;
    private boolean isToasted;
    private boolean chat_created;
    private boolean loggedin;
    Chat chat;
    public void init(String userId, String pwd, EventChannel.EventSink eventSink) throws XmppStringprepException {
        Log.i("XMPP", "Initializing!");
        this.userName = userId;
        this.passWord = pwd;
        XMPPTCPConnectionConfiguration.Builder configBuilder = XMPPTCPConnectionConfiguration.builder();
        configBuilder.setUsernameAndPassword(userName, passWord);
        connection = new XMPPTCPConnection(configBuilder.build());
        chatManager = ChatManager.getInstanceFor(connection);
                new ChatManagerListener() {
                    public void chatCreated(Chat chat, boolean createdLocally) {
                                new ChatMessageListener() {
                                    public void processMessage(Chat chat, Message message) {
                                        System.out.println(chat.getParticipant() + ":" + message.getBody());
                                        Log.e("Message Received : ",message.getBody());
                                        Log.e("Message ID : ",message.getStanzaId());

    public void connect() {
        AsyncTask<Void, Void, Boolean> connectionThread = new AsyncTask<Void, Void, Boolean>() {
            protected Boolean doInBackground(Void... arg0) {
                try {
//                    login();
                    connected = true;
                } catch (IOException e) {
                } catch (SmackException e) {
                } catch (XMPPException e) {
                } catch (InterruptedException e) {
                return null;

and the strange this is im still able to connect to my openfire server from Spark Windows Client

OK its resolved the problem was at my dns …actually i reseted my dns records and things gets messed up

1 Like

This topic was automatically closed 62 days after the last reply. New replies are no longer allowed.