powered by Jive Software

Can't send message to Spark client from Java simple client

Hi, on a Spark 2.5.2 client I can’t receive a message sent from a simple Java client.

I’ve the Java client realized with Smack 3.0.4 (same problem with 3.0.2) on a Win XP sp2 (ip address=, no firewall).

And OpenFire 3.3.1 + Spark 2.5.2 on another Win XP sp2 (ip address=, computer name=HPI15000).

Both boxes have in the hosts file: HPI15000

Tried OpenFire 3.3.2 as well, but reised SASLAuthentication errors in addition, so downgraded.

Java client doesn’t show XMPP exceptions, source follows:

public void send() {

XMPPConnection conn1;

try {

// Create a connection to the jabber.org server on a specific port.

ConnectionConfiguration cc = new ConnectionConfiguration(“”, 5222);


conn1 = new XMPPConnection(cc);


System.out.println(“Connection with server established”);

// Login as a user

conn1.login(“myadmin”, “myadmin”);

System.out.println(“Login ok”);

Message message = new Message();




System.out.println("Message = "+message.toXML());



System.out.println(“Message sent”);


System.out.println(“Client - server disconnected”);

} catch (XMPPException e) {

// TODO Auto-generated catch block




OpenFire debug log reports what follows:

2007.08.24 16:48:53 OS - Trying to connect to lookup:

2007.08.24 16:48:53 Connect Socket[http://addr=/,port=1246,localport=5269|http://addr=/,port=12 46,localport=5269]

2007.08.24 16:48:53 OS - Plain connection to successful

2007.08.24 16:48:53 OS - Error,

java.lang.Exception: Failed to create connection to remote server

at org.jivesoftware.openfire.server.OutgoingSessionPromise$PacketsProcessor.sendPa cket(OutgoingSessionPromise.java:212)

at org.jivesoftware.openfire.server.OutgoingSessionPromise$PacketsProcessor.run(Ou tgoingSessionPromise.java:184)

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Any thought ?



This is all in a LAN? I’d suggest adjust your IP adressing scheme to the standards (something like 168.192.x.x).

Try using the host name in all cases, since you went and put it in the hosts file already - don’t use the IP adress. I think Openfire goes to look for it on the internet (see about IP adressing schema above). Also put that host name as the name for the OpenFire server, and in your jids.

Thanks a lot, it helped solving the problem.

I’ve plugged the box with OpenFire on another subnet and adjusted hosts file accordingly. The weird thing is that the Spark client on the same box has to address the server with the ip address and not with the computer name that could be solved with “nslookup”; mabe a bug in java.net.* classes? I heard about a bug some time ago.

Anyway my tests can proceed.