Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • Unhandled exception type XmppStringprepException

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 607
    Answer it
    import org.jivesoftware.smack.tcp.XMPPTCPConnection;
    import org.jivesoftware.smack.tcp.XMPPTCPConnectionConfiguration;
    import org.jxmpp.jid.DomainBareJid;
    import org.jxmpp.jid.EntityBareJid;
    import org.jxmpp.jid.Jid;
    import org.jxmpp.jid.impl.JidCreate;
    import org.jxmpp.jid.util.JidUtil;
    import org.jxmpp.stringprep.XmppStringprepException;
    public class chat_try {
    public static void main(String args[]) 
    //DomainBareJid serviceName = JidCreate.bareFrom("test3@");
    //Jid jid= JidCreate.from("test3@");
    //Jid myJid = Jid("","",""); 
    //Jid jid= JidCreate.from("");
    String var = "";
    EntityBareJid jid = JidCreate.entityBareFrom(var);
    XMPPTCPConnectionConfiguration config = XMPPTCPConnectionConfiguration.builder()
            .setUsernameAndPassword("test3", "elkill")
            .setDebuggerEnabled(true) // to view what's happening in detail
    XMPPTCPConnection conn1 = new XMPPTCPConnection(config);
    try {
        if(conn1.isConnected()) {
        if(conn1.isAuthenticated()) {
    catch (Exception e) {

    This is my code for a simple XMPP user connection configuration using "smack" library.It requires a "XMPPDomain" to work. There's a ".setXmppDomain()" method for setting the domain, it takes a "DomainBareJid" as an argument, my attempts to convert a string to DomainBareJid using all the above libraries are resolving to the same error, "Unhandled exception type XmppStringprepException", help!

    Sorry if it's a bad doubt, I'am new to Java coding.:)

 0 Answer(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: