first each of the pc’s must have a valid DNS entry and openfire must be confured to match the DNS entry. Second their firewalls must allow all the traffic for S2S. It should then be as easy as entering the full ID of the user in the roster (for eaxmple: user2@pc2.domain.com).
Both pc are in same room (I don’t need of internet communication between 2 because it’s a simulation in laboratory for now).
Do you think I need of DNS anyway?
have you configured the xmpp.domain value of 10.11.7.1 to be centroservizi.lit.ing.unicas.it and 10.11.9.1 to be autotreno.lit.ing.unicas.it?
After configuring the correctly the xmpp.domain value on both servers, verify that centroservizi.lit.ing.unicas.it can be resolved by autotreno.lit.ing.unicas.it and vise versa. I think to make this successfull is enough (not need for DNS, you can define the hosts in for example each server’s /etc/hosts -file), but I might be wrong. Sorry, i did not have time to test.
The OS installed on both pc is FEDORA and I already disable all firewall.
How I can start the communication between 2 server?
How I can be sure that server of pc1 see server of pc2?
By default server-2-server functionality should be enabled after installing Openfire. To verify this you should see both servers listening port 5269 (if you have not changed them ofcourse) example with using netstat.
To test if the “server 1 sees server 2” you should be able to forexample telnet from centroservizi.lit.ing.unicas.it to autotreno.lit.ing.unicas.it’s port 5269.
If you are stuck I think the best is that you connect to centroservizi.lit.ing.unicas.it with user1 and try to send a message to user2@autotreno.lit.ing.unicas.it. If the sending of messages does not work please copy paste the errors you will see in the OpenFire’s logs.
Now, if I try to contact user warning from user tir they can’t speak beacause both user are see as “PENDING”.
But, I’m thinking that the problem is the pc-router, because I have installed openfire on pc-router too, I did the same things that I have done for pc1 and the S2S connection between pc-router and pc2 has been established (user tir (that is logged on pc2) speaks with user “prova” (that is logged on pc-router).
Why The connection S2S between pc-router(eth0 10.11.9.7) <—> pc2(eth0 10.11.9.1) is ok (single link) and instead the connection between pc1 <–> pc-router <–> pc2 (double link) is refused? What do you think about it?
I think the most frustrating thing is that the logic that causes s2s to send a “remote-server-not-found” is not sending any reasons to the error or debug logs. It would help incredibly if the error packet at least said -which- remote server was not found.
Also, there appears to be an NPE showing up in the error log:
java.lang.NullPointerException
at java.util.concurrent.LinkedBlockingQueue.extract(LinkedBlockingQueue.java:157)
at java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:440)
at org.jivesoftware.openfire.pubsub.PublishedItemTask.run(PublishedItemTask.java:7 0)
at java.util.TimerThread.mainLoop(Timer.java:527)
at java.util.TimerThread.run(Timer.java:477)
2008.10.15 11:19:04 [org.jivesoftware.openfire.pubsub.PublishedItemTask.run(PublishedItemTask.java: 79)] Internal server error
I connected pc1 with pc2 without pc router and user of pc1 cant speak with user of pc2 (the users are both “PENDING” and so S2S connection is impossibile).
So, now I think that the problem is on pc2…
Then I tryed to connect user of pc1 on server of pc2 for can speak user of pc1 and user of pc2, and this connection is impossibile, too!
I do another test; I have changed the server name of both server so:
Server name of pc1 10.11.7.1
Server name of pc2 10.11.9.1
I try to do speak user on pc1 (warning) with user on pc2 (tir) but S2S connection can’t be established.
The warning log openfire is:
2008.10.17 09:51:15 Error returning error to sender. Original packet:
org.jivesoftware.openfire.PacketException: Cannot route packet of type IQ or Presence to bare JID:
at org.jivesoftware.openfire.spi.RoutingTableImpl.routePacket(RoutingTableImpl.jav a:217)
at org.jivesoftware.openfire.server.OutgoingSessionPromise$PacketsProcessor.return ErrorToSender(OutgoingSessionPromise.java:285)
at org.jivesoftware.openfire.server.OutgoingSessionPromise$PacketsProcessor.run(Ou tgoingSessionPromise.java:219)
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)
The first two main requirements are (as described in above doc):
Server-2-server communication occurs on port 5269 (by default).
So the first thing to check is that there is no firewall closing that port.
The second task would be to verify that the server name of each Openfire server can be resolved by the DNS. XMPP servers will do a DNS SRV look up to figure out the actual IP address and port to use to connect to the remote server.
You can check the first requirement forexample on pc1 doing “$telnet 10.11.7.1 5269” and vise versa on pc2. Does that work?
Socket[addr=/192.168.5.2,port=33100,localport=5269]
2009.07.29 13:00:08 Connexion clôturée avant l établissement de la session
2009.07.29 13:00:07 ServerDialback: RS - Trying to connect to Authoritative Server: srv1:5269(DNS lookup: srv1:5269)
2009.07.29 13:00:07 ServerDialback: RS - Received dialback key from host: srv1 to: srv2
2009.07.29 13:00:07 Connect Socket[addr=/192.168.5.2,port=8073,localport=5269]
Connexion clôturée avant l’établissement de la session /
Connection closed before the establishment of the session
got a similar proble few year ago (think it was openfire vesion 3.3) … but it sounds like the same problem…
in my case its all about dns verification !
it was NOT possible to insert the pc-name into /etc/hosts, the server name must be resolvable by a dns lookup.
For example: in a private network at home it was impossible to establish a s2s connection, the only way to get the connection up was setting up the servers on two pc’s which were in the domain of the university with a qualified dns-server. the other way is to set up the servers on the internet where the names can be resolved via global dns.
Further the configured name of the openfire MUST be the full qualified dns name… otherwise i got connection errors when i tried to establish the s2s connection.
dont now if there were made some changes in the past year but when i developed a plugin using s2s communication both (all) server names must be resolvable via the same dns.
if server1 is in dmz and tries to connect to server2 (in lan) it makes a dns-lookup to its assigned dns - in this case ur server in the lan can’t be resolved.
so in this configuration i think its not possible to get a s2s connection.
maybe its possible to setup ur server within the lan using ur wan ip (or domainname if resolved to ur wan ip) as servername and use nat to forward all necessary ports to ur server-machine within the lan …