Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

issue in Registration using asmack library and open fire as server

Hi i got error in Registration using asmack library . code of Registration

Log.d(TAG, "creating new server account...");
                    AccountManager am = new AccountManager(connection);
                    Log.i("Registration Details:","UaerName = "+config.userName + "  Password is ==" + config.password);
                    am.createAccount(config.userName, config.password);

smack logs which i got :

<main>09-14 12:18:08.132: D/yaxim.SmackableImp(5933): creating new server account...
09-14 12:18:08.142: D/SMACK(5933): 12:18:08 PM SENT (1089044856): <iq id="Ii5WG-0" to="myHost" type="get"><query xmlns="jabber:iq:register"></query></iq>
09-14 12:18:08.522: D/SMACK(5933): 12:18:08 PM RCV  (1089044856): <iq type="result" id="Ii5WG-0" from="myHost"><query xmlns="jabber:iq:register"><username/><password/><email/><name/><x xmlns="jabber:x:data" type="form"><title>XMPP Client Registration</title><instructions>Please provide the following information</instructions><field var="FORM_TYPE" type="hidden"><value>jabber:iq:register</value></field><field var="username" type="text-single" label="Username"><required/></field><field var="name" type="text-single" label="Full name"/><field var="email" type="text-single" label="Email"/><field var="password" type="text-private" label="Password"><required/></field></x></query></iq>
09-14 12:18:08.562: D/SMACK(5933): 12:18:08 PM SENT (1089044856): <iq id="Ii5WG-1" to="myHost" type="set"><query xmlns="jabber:iq:register"><email></email><password></password><username></username><name></name></query></iq>
09-14 12:18:08.933: D/SMACK(5933): 12:18:08 PM RCV  (1089044856): <iq type="error" id="Ii5WG-1" from="myHost" to="myHost/8f0bf952"><query xmlns="jabber:iq:register"><email/><password/><username/><name/></query><error code="500" type="wait"><internal-server-error xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error></iq>
09-14 12:18:08.953: I/yaxim.Service(5933): connectionFailed: internal-server-error(500)</main>

Here i got internal-server-error. Error code = 500. can anyone help me. Thanks in advance.

I am using asmack-issue 15.jar library.

like image 278
nitin tyagi Avatar asked Sep 14 '12 07:09

nitin tyagi


1 Answers

I solved this issue.. There is a problem in createAccount(config.userName, config.password); method of smack-issue 15.jar library.

Using another method for createAccount solve my problem.

AccountManager am = new AccountManager(mXMPPConnection);
                Log.i("Registration Details:", "UaerName = "
                        + mConfig.userName + "  Password is =="
                        + mConfig.password);
                Map<String, String> mp = new HashMap<String, String>();

                // adding or set elements in Map by put method key and value
                // pair
                mp.put("username", mConfig.userName);
                mp.put("password", mConfig.password);
                mp.put("name", mConfig.userName);
                mp.put("email", "");

                // am.createAccount(mConfig.userName, mConfig.password);
                am.createAccount(mConfig.userName, mConfig.password, mp);
like image 69
nitin tyagi Avatar answered Oct 27 '22 10:10

nitin tyagi