Hi Flow,
Please help!
I gave it a shot and am stuck with this issue now. I am unable to connect to the server from my test client.
Looks like the request never hits the server. I am pretty sure the url is fine as I can do the same on the browser. I am using the Tigase XMPP Server and it does support BOSH.
Timeout reached for the connection to null:0.: remote-server-timeout(504) Timeout reached for the connection to null:0.
at org.jivesoftware.smack.BOSHConnection.connect(BOSHConnection.java:227)
at org.jivesoftware.smack.SmackBOSHExample.main(SmackBOSHExample.java:14)
This is the code I am trying to test:
package org.jivesoftware.smack;
import org.jivesoftware.smack.Connection;
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smack.packet.Presence;
public class SmackBOSHExample {
public static void main(String args[]){
BOSHConfiguration config = new BOSHConfiguration(false, “IP”, 5280, “/xmpp-httpbind”, “domainname”);
Connection conn = new BOSHConnection(config);
try {
conn.connect();
conn.login(“userid”, “password”);
System.out.println(“Logged in user”);
Presence presence = new Presence(Presence.Type.available, “on-call”,
10, Presence.Mode.dnd);
conn.sendPacket(presence);
System.out.println(“Set presence”);
Thread.sleep(15000);
System.out.println(“About to disconnect”);
conn.disconnect();
} catch (InterruptedException ie) {
// TODO Auto-generated catch block
ie.printStackTrace();
} catch (XMPPException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
The connect timesout as the packet is not sent to the server at all and hence there is no response.
When I debugged the code, I see that there are no request listeners set on the jbosh’s BOSHClient class.
The “fireRequestSent” method loops on the available listeners and it has none for this client. Not sure if this is a problem.
But one thing I am sure of is that, the request never hits the server at all.
I got jbosh and its dependencies from this location.
http://grepcode.com/snapshot/repo1.maven.org/maven2/com.kenai.jbosh/jbosh/0.6.0
Do you see any issues or do you have any clues that could help?
Thanks a lot for your time,
Vicson.