After I found a JBoss book I figured out that UIL is what I must use... But I still haven't found a solution to my question. It seems that my problem is that the server only has an "internal" IP address (the external address is mapped in the firewall). When the server passes it's ServerIL object to the client, this object only contains the internal IP address and this is the one the client uses to connect.
I've been wondering if I must implement a new ClientSocketFactory or something that knows the servers real address, but this seems rather overkill for such a problem. Hopefully some of you have solved this problem more elegantly...?
Have you tried to use UIL2? That is a new experimental layer in 3.0.7.
From the docs:
The Unified version 2 Invocation Layer (UIL2) is a new variation of the UIL protocol that also uses a single socket between the client and server. However, unlike both the UIL and OIL protocols which use a blocking round-trip message at the socket level, the UIL2 protocol uses a true asynchrounous send and receive messaging at the transport level. This provides for improved throughput and utilization and as such it is the preferred socket invocation layer.
We're stuck running 2.4.10 and have a similar problem.
I have one machine behind a security appliance where it
has non-routable ip addresses. All ports are open and
mapped 1-1 for all ip addresses.
A lookup of ConnectionFactory or UILConnectionFactory
would return the OILServerIL/UILServerIL which would
have the non-routable IP address in the InetAddress
My solutions is to add the following line to createConnection before creating the new socket:
addr = InetAddress.getByName (addr.getHostName());
in each of:
On the machine behind the security device
I also had to add a property at startup time:
where foo.bar.com is the name that resolves
properly for all places.