Project

General

Profile

406: Not acceptable

Indrajeet Kumar
Added over 3 years ago

I installed latest tigase-server-7.0.2-b3821.jar and I am getting 406:Not Acceptable error after creating buddy.

my init.properties file is

--cluster-mode = true
config-type = --gen-config-all
--debug = server,xmpp.impl
--user-db = mysql
--admins = admin@xmpp1.domain.com
--user-db-uri = jdbc:mysql://tigasedb.amazonaws.com/tigasedb_new?user=domain&password=domainpswd
--virt-hosts = xmpp1.domain.com
--comp-class-1 = tigase.archive.MessageArchiveComponent
--comp-name-1 = message-archive
--sm-plugins = +message-archive-xep-0136,+jabber:iq:auth,+urn:ietf:params:xml:ns:xmpp-sasl,+urn:ietf:params:xml:ns:xmpp-bind,+urn:ietf:params:xml:ns:xmpp-session,+jabber:iq:register,+jabber:iq:roster,+presence,+jabber:iq:privacy,+jabber:iq:version,+http://jabber.org/protocol/stats,+starttls,+msgoffline,+vcard-temp,+http://jabber.org/protocol/commands,+jabber:iq:private,+urn:xmpp:ping,+basic-filter,+domain-filter,+pep,-zlib

Replies (5)

Added by Daniel Wisnewski IoT 1 Cloud over 3 years ago

Hello Indrajeet,

Your init.properties file looks OK. Are you getting an error 406 from XML console? If so, can you post the stanza exchange between you and the server?

Are you able to login to the admin account you made when you setup the server?

I would also recommend upgrading to our latest build, b4017 here: http://build.xmpp-test.net/nightlies/dists/2015-09-24/

Added by Indrajeet Kumar over 3 years ago

I am getting this error in pidgin client, when I create buddy. So when user from my roster comes online I get this error. I have installed this on amazon ec2, ubuntu 14.04

Added by Wojciech Kapcia TigaseTeam over 3 years ago

Indrajeet Kumar wrote:

I am getting this error in pidgin client, when I create buddy.

How do you create the buddy?

So when user from my roster comes online I get this error. I have installed this on amazon ec2, ubuntu 14.04

Please share EXACT steps you take to create the buddy that triggers the issue.

Added by Indrajeet Kumar over 3 years ago

Step1 - 
I created one A record for the IP address something like xmpp.domain.com.

Step 2- 
I then changed hostname of instance from amazon internal IP "ip-172-xx-x-x03" address to "xmpp.domain.com". 

Step3 -
java -jar tigase-server-7.0.2-b3821.jar -console

installed tigase server

Step4 - Started server
code for creating connection
public XmppManager(String username, String password) throws XMPPException, SmackException, IOException {
        XMPPTCPConnectionConfiguration conf= XMPPTCPConnectionConfiguration.builder()       
                .setServiceName(JABBER_DOMAIN)
                .setSecurityMode(SecurityMode.disabled)
                .build();
            //Connect to the server

            connection = new XMPPTCPConnection(conf);
            connection.connect();
            connection.login(username, password);
    }

Code for registering jabberId
public void createAccount(String username, String password) throws XMPPException, NoResponseException, NotConnectedException{
        try{
            AccountManager accountManager = AccountManager.getInstance(connection);
            HashMap<String, String> attr = new HashMap<>();
            attr.put("username", username);
            attr.put("password", password);
            accountManager.createAccount(username, password, attr);
        }finally{
            connection.disconnect();
        }
    }
Code for maiking buddy
public static void makeBuddy(XMPPTCPConnection connectionUser1, XMPPTCPConnection connectionUser2, String user1, String user2) throws NotConnectedException, InterruptedException{
        Logger.info("subscribing user2 = " + user2);
        Presence subscribeUser2 = new Presence(Presence.Type.subscribe);
        subscribeUser2.setTo(user2);
        connectionUser1.sendPacket(subscribeUser2);

        Thread.sleep(1000);
        Logger.info("subscribed user2 = " + user2);
        Presence subscribedUser1 = new Presence(Presence.Type.subscribed);
        subscribedUser1.setTo(user1);
        connectionUser2.sendPacket(subscribedUser1);

        Thread.sleep(1000);
        Logger.info("subscribing user1 = " + user1);
        Presence subscribeUser1 = new Presence(Presence.Type.subscribe);
        subscribeUser1.setTo(user1);
        connectionUser2.sendPacket(subscribeUser1);

        Thread.sleep(1000);
        Logger.info("subscribed user1 = " + user1);
        Presence subscribedUser2 = new Presence(Presence.Type.subscribed);
        subscribedUser2.setTo(user2);
        connectionUser1.sendPacket(subscribedUser2);
    }

Everything works fine roster is getting created. Users can chat. Only problem is when one User goes offline, presence of the offline user to other online users is fluctuating between online/offline frequently.

Note: If I don't do step-2 I get 406: Not acceptable error

Added by Daniel Wisnewski IoT 1 Cloud over 3 years ago

It could be your code is creating usernames with the default domain user@machinename as opposed to user@xmpp.domain.com

Be sure that your vhost configuration is properly setup (init.properties says xmpp1.domain.com).

Also are all users connected from the same machine as the host? Same network?

    (1-5/5)