Ole8700 / openhab

Automatically exported from code.google.com/p/openhab
GNU General Public License v3.0
1 stars 0 forks source link

XMPP: Not connected to server #226

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. XMPP connection gets disconnected due to network, server error.
2. When a message gets send, a disconnected XMPPConnection is returned.

What is the expected output? What do you see instead?
Expect connected to be re-established and message to be sent.  Instead I see: 
10:56:51.538 ERROR o.o.c.s.ScriptExecutionThread[:70] - Error during the 
execution of rule 'Alarm notification': Not connected to server.

What version of the product are you using? On what operating system?
1.2.0 - from repo.

Please provide any additional information below.
A check for XMPPConnection.isConnected() should be added in 
XMPPConnect.getConnection()

https://code.google.com/p/openhab/source/browse/bundles/io/org.openhab.io.net/sr
c/main/java/org/openhab/io/net/internal/jabber/XMPPConnect.java

Suggestion:

    public static XMPPConnection getConnection() throws NotInitializedException {
        //assuming connection can't be null
        if(!initialized || !connection.isConnected()) {  
            establishConnection();
            if(!initialized) {
                throw new NotInitializedException();
            }
        }
        return connection;
    }

Original issue reported on code.google.com by t...@ducbase.com on 2 Apr 2013 at 2:26

GoogleCodeExporter commented 9 years ago
fixed with change set 
http://code.google.com/p/openhab/source/detail?r=8959e75743dc2743c8cb4c5282b2ef4
328748bfb

Original comment by teichsta on 4 Apr 2013 at 11:29