XMPP server giving error "No response from server"
hi i am using smack.jar to connect to my gmail server. but xmppconnection.connet() is failing and it says that server is not responding . i am attaching the log. please help me out.
Exception in thread "main" Connection failed. No response from server.: at org.jivesoftware.smack.Pack开发者_如何学GoetReader.startup(PacketReader.java:164) at org.jivesoftware.smack.XMPPConnection.initConnection(XMPPConnection.java:945) at org.jivesoftware.smack.XMPPConnection.connectUsingConfiguration(XMPPConnection.java:904) at org.jivesoftware.smack.XMPPConnection.connect(XMPPConnection.java:1415) at JabberSmackAPI.login(JabberSmackAPI.java:29) at JabberSmackAPI.main(JabberSmackAPI.java:79)
To be clear, the server isn't returning this error, because you haven't connected to the server yet.
It might be a configuration problem. If your server doesn't have a client DNS SRV record (e.g. _xmpp-client._tcp.gmail.com
), then you'll need to pass the XMPPConnection
object a ConnectionConfiguration
with the name of the machine to connect to for your domain.
It is also possible that this is a network problem (connectivity, routing, firewall, etc.). To test for this, try commands like this on the command line:
% dig +short _xmpp-client._tcp.gmail.com SRV
5 0 5222 talk.l.google.com.
20 0 5222 talk2.l.google.com.
20 0 5222 talk1.l.google.com.
20 0 5222 talk3.l.google.com.
20 0 5222 talk4.l.google.com.
% telnet talk.l.google.com 5222
Trying 74.125.155.125...
Connected to talk.l.google.com.
Escape character is '^]'.
>
Note that you type the greater-than character. Most XMPP servers will disconnect you immediately at this point, since you've sent them XML that is not well-formed.
If you've got a network problem, you'll see something like this:
Trying 74.125.155.125...
telnet: connect to address 74.125.155.125: Connection refused
telnet: Unable to connect to remote host
精彩评论