Hi I’m just playing around with smack and testing it out for future apps and I have run into a problem sending a file from one user to another. my code is below.
+import org.jivesoftware.smack.*;+
+import org.jivesoftware.smack.packet.Message;+
+import java.io.*;+
+import org.jivesoftware.smackx.filetransfer.*;+
public class RsUfClient
{
public RsUfClient()
{
}
public static void main (String[] args) {
XMPPConnection connection = new XMPPConnection(“gmail.com”);
try
{
connection.connect();
*connection.login("rsuftesting@gmail.com", "
");*
Chat chat = connection.getChatManager().createChat("chrisishere@gmail.com", new MessageListener() {
public void processMessage(Chat chat, Message message) {
*System.out.println("Received message: " * message);+
}
});
chat.sendMessage(“Howdy!”);
}
catch (Exception e) {
System.out.println(e);
}
// Create the file transfer manager
FileTransferManager manager = new FileTransferManager(connection);
-
System.out.println("working so far");+
// Create the outgoing file transfer
OutgoingFileTransfer transfer = manager.createOutgoingFileTransfer("chrisishere@gmail.com");
-
+
// Send the file
try
{
transfer.sendFile(new File(“blah.txt”), “You won’t believe this!”);
}catch (Exception e)
{
System.out.println(e);
}
}
everything compiles properly but when ran, it gets the following error: Exception in thread “main” java.lang.IllegalArgumentException: The provided user id was not fully qualified. It is having problems with the jabber id: chrisishere@gmail.com but not sure why. Ive tried other usernames and same problem so I can only assume my code is having issues. anyone know the reason? much help is appreciated, thanks
}