Help with spark and openfire

I recently installed OpenFire on a Win 2012 r2 server. Open fire seems to be working, I can access the admin portal from any computer on my network. Setup to use ldap through AD.

If I telnet to the server on port 5222 it just sits at a blank cmd screen, is this normal? I read a bunch of posts asking users if they could telnet to it. I would say yes? Since I didn’t get an error saying it couldn’t connect.

When I try to connect using spark, it says “authenticating” for about 5 seconds then I get an error. “Unknown connection error”. I have tried manually typing the host in and setting it to auto. If I change it to a different server or port it errors out right away.

The logs show this.

Text

WARNING: Exception in Login:

org.jivesoftware.smack.SmackException$NoResponseException: No response received within reply timeout. Timeout was 10000ms (~10s). Used filter: No filter used or filter was 'null'.

at org.jivesoftware.smack.SmackException$NoResponseException.newWith(SmackException.java:106)

at org.jivesoftware.smack.SmackException$NoResponseException.newWith(SmackException.java:85)

at org.jivesoftware.smack.SynchronizationPoint.checkForResponse(SynchronizationPoint.java:253)

at org.jivesoftware.smack.SynchronizationPoint.checkIfSuccessOrWait(SynchronizationPoint.java:146)

at org.jivesoftware.smack.SynchronizationPoint.checkIfSuccessOrWaitOrThrow(SynchronizationPoint.java:125)

at org.jivesoftware.smack.tcp.XMPPTCPConnection.connectInternal(XMPPTCPConnection.java:858)

at org.jivesoftware.smack.AbstractXMPPConnection.connect(AbstractXMPPConnection.java:364)

at org.jivesoftware.LoginDialog$LoginPanel.login(LoginDialog.java:1078)

at org.jivesoftware.LoginDialog$LoginPanel.access$900(LoginDialog.java:335)

at org.jivesoftware.LoginDialog$LoginPanel$3.construct(LoginDialog.java:869)

at org.jivesoftware.spark.util.SwingWorker.lambda$new$1(SwingWorker.java:142)

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

Running debug on spark shows packets sent :

<stream:stream xmlns=‘jabber:client’ to=‘server’ xmlns:stream=‘http://etherx.jabber.org/streams’ version=‘1.0’ from='username@server xml:lang=‘en’>

No packets received. Any one have any ideas?

I have ports 5222 and 5223 open on the firewall, even though the firewall is disabled. I also can connect into the admin console using my ldap creds.

You don’t need port 5223, although if you have firewall disabled it doesn’t matter. What does netstat -a shows locally on the server? Is it listening on 5222 port? I haven’t tried the telnet check, but it seems to me it would have to show some response.

Yes it is listening on 5222.

Is there any other logs that would be helpful?

Well, i don’t know what else to check. Maybe Openfire logs.

I am getting this on open fire window

Openfire 4.0.3 [Nov 4, 2016 9:55:54 AM]

Admin console listening at:

http://server:5222

https://server:9091

Error starting 5222: Address already in use: bind

2016.11.08 13:10:21 ERROR [pool-3-thread-1]: org.jivesoftware.openfire.spi.MINAConnectionAcceptor[socket_c2s] - Error starting: 5222

java.net.BindException: Address already in use: bind

at sun.nio.ch.Net.bind0(Native Method)

at sun.nio.ch.Net.bind(Unknown Source)

at sun.nio.ch.Net.bind(Unknown Source)

at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source)

at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source)

at org.apache.mina.transport.socket.nio.NioSocketAcceptor.open(NioSocketAcceptor.j ava:198)

at org.apache.mina.transport.socket.nio.NioSocketAcceptor.open(NioSocketAcceptor.j ava:51)

at org.apache.mina.core.polling.AbstractPollingIoAcceptor.registerHandles(Abstract PollingIoAcceptor.java:547)

at org.apache.mina.core.polling.AbstractPollingIoAcceptor.access$400(AbstractPolli ngIoAcceptor.java:68)

at org.apache.mina.core.polling.AbstractPollingIoAcceptor$Acceptor.run(AbstractPol lingIoAcceptor.java:422)

at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)

at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

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

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

5222 port is in use by some other app (maybe you have Openfire running two times, one as a service and one via graphical launcher). Run TCPView application and see what exactly is listening on 5222 local port.

I do not have it running as a service. it shows that the admin console is running on that port. I changed this setting(below) in [server settings>client connections] from 5222 to 5224 for grins. Still getting the same error in spark but now I am getting received raw packets in the spark debugger.

Plain-text (with STARTTLS) connections

Openfire can accept plain-text connections, which, depending on the policy that is configured here, can be upgraded to encrypted connections (using the STARTTLS protocol).

Advanced configuration…

the console should not be using 5222.

open openfire.xml and change the console port from 5222 to 9090

restart openfire

Ok I remember changing that to 5222. But it was because when I launch openfire it just sits there. It does not say the admin console is listening etc… I also I can not access the admin console on the port through the browser. When I changed it to 5222 everything worked as far as the admin console.

OK, since 9090 wouldn’t work I changed it to 5228. I can access the admin console and now when I use spark it says “Unable to verify certificate”, I am not sure if that’s progress but its different than before.

Edit: If I use the “accept all certs” option in spark it connects. But should I be using this?

If you are going to use this self-signed certificate (which was probably generated by Openfire during the setup) then yes, you will have to check that option in Spark.

It should work with 9090 (though you will probably still want to use the encrypted one 9091 instead). maybe something is using 9090 port on that server.