powered by Jive Software

Connection error ? hot

I run the smakc api,I find a problem

when i run the code blews that it works very good.

public static void main(String[] args) throws XMPPException {

XMPPConnection connection=new XMPPConnection(“localhost”);

connection.login(“web1”,“web1”);

}

but when i change localhost to my ip,it can work

public static void main(String[] args) throws XMPPException {

XMPPConnection connection=new XMPPConnection(“172.16.80.23”);

//172.16.80.23 is the ip of the localhost

connection.login(“web1”,“web1”);

}

the error message is:

No response from the server.:

at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:276)

at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:237)

at test.Test2.main(Test2.java:26)

What server are you running?

Is the server configured to bind to that IP? (e.g in jabberD the default config binds to localhost which is 127.0.0.1 as an IP)

Does it work if you replace 172.16.80.23 with 127.0.0.1 ? If yes, check the server configuration.

HTH, Pheet

when i replace my ip to 127.0.0.1,it is not work either

this is the message:

No response from the server.:

at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:276)

at test.Test2.main(Test2.java:24)

Exception in thread “main”

only the localhost can work

what is the problem???

thank you for your reply