Hello,
first off, I’‘m relatively new to Java and XMPP, so you’'ll have to excuse myself if I did something really stupid
I heard of Smack and tought that it must be really neat and quickly threw together a little test class. Sending a message works as expected, but I keep getting errors after it was sent. Maybe you’‘ll know better. Googling and searching the forums didn’'t return anything useful
Here’'s the complete code (of course I replaced the usernames and passwords with real jabber accounts):
import org.jivesoftware.smack.*;
public class HelloJabberClass {
public static void main(String[] args) {
XMPPConnection connection = new XMPPConnection(“web.de”);
try {
connection.connect();
} catch (XMPPException e) {
e.printStackTrace();
}
try {
connection.login(“maik.hoepfel”, “ubersecretpwd”);
} catch (XMPPException e) {
e.printStackTrace();
}
Chat chat = connection.getChatManager().createChat("test@test.de", null);
try {
chat.sendMessage(“Moritz, mein großer Held!”);
} catch (XMPPException e) {
e.printStackTrace();
}
}
}
The error I get is:
Error! A startup class specified in smack-config.xml could not be loaded: org.jivesoftware.smackx.ServiceDiscoveryManager
Error! A startup class specified in smack-config.xml could not be loaded: org.jivesoftware.smackx.XHTMLManager
Error! A startup class specified in smack-config.xml could not be loaded: org.jivesoftware.smackx.muc.MultiUserChat
Error! A startup class specified in smack-config.xml could not be loaded: org.jivesoftware.smackx.filetransfer.FileTransferManager
Error! A startup class specified in smack-config.xml could not be loaded: org.jivesoftware.smackx.LastActivityManager
Error! A startup class specified in smack-config.xml could not be loaded: org.jivesoftware.smackx.ServiceDiscoveryManager
Error! A startup class specified in smack-config.xml could not be loaded: org.jivesoftware.smackx.XHTMLManager
Error! A startup class specified in smack-config.xml could not be loaded: org.jivesoftware.smackx.muc.MultiUserChat
Error! A startup class specified in smack-config.xml could not be loaded: org.jivesoftware.smackx.filetransfer.FileTransferManager
Error! A startup class specified in smack-config.xml could not be loaded: org.jivesoftware.smackx.LastActivityManager
I’'m confused as I did not even load smackx… shrug The only thing that I did different from what the examples in the docs said is that I did not include a function to be called when a message is received, simply because the example gave me compiler errors.
Thanks.
Message was edited by: edelholz