powered by Jive Software

Problem disconnecting and connecting as new user

I have a simple setup where I connect as user “test1” and send a file across - this all work fine. However, when i send another file (same instance of program) with user test2 i get:

loging in test1
connect user test1

loging in test2

Exception in thread “Thread-13” java.lang.IllegalArgumentException: Connection cannot be null
at org.jivesoftware.smackx.filetransfer.FileTransferNegotiator.getInstanceFor(File TransferNegotiator.java:95)
at org.jivesoftware.smackx.filetransfer.FileTransferManager.(FileTransferMan ager.java:63)
at edu.ou.kmi.buddyspace.connection.core.ConnectionService.fileSendTest(Connection Service.java:368)
at edu.ou.kmi.buddyspace.connection.core.ConnectionService$2.run(ConnectionService .java:351)
connect user test2
Exception in thread “Thread-14” java.lang.IllegalStateException: Already logged in to server.
at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:408)
at edu.ou.kmi.buddyspace.connection.core.ConnectionService$2.run(ConnectionService .java:349)

I did call XMPPConnection.disconnect() on test1 before hand and have called disconnect() in ConnectionService as well but it seems to be trying to connect test1 again and messing things up. The presence on the gui does show test1 logged off after i send the file with test1 but test1 comes back when i try to send file with test2… any ideas? thanks