> On Apr 22, 2024, at 18:48, Rick Noel <rn...@westwoodone.com.INVALID> wrote:
> 
> So you mean we use the VM's  IP as the address value below........
> Instead or using the value of   auto  ?
> 
> <Receiver className="org.apache.catalina.tribes.transport.nio.NioReceiver"
>                            address="auto"
>                            port="4001"
>                           autoBind="100"
>                           selectorTimeout="5000"
>                           maxThreads="6"/>


Correct. To quote from the Tomcat doc:

The IP broadcasted is java.net.InetAddress.getLocalHost().getHostAddress() 
(make sure you don't broadcast 127.0.0.1, this is a common error)

Unless the two JVMs are deployed on the same VM, you cannot use 127.0.0.1 and 
expect them to be able to communicate with each other.

Here’s an old e-mail describing the issue and one way of addressing it:

https://marc.info/?l=tomcat-user&m=118764351104059&w=2

The gist of it is this:

1. check what name the command `hostname` spits out
2. make sure that /etc/hosts contains that hostname and IP address

This must be done on each VM, of course. 

Returning localhost is typical for systems that use DHCP to obtain their IP 
addresses, such as my MacBook:

jshell> java.net.InetAddress.getLocalHost().getHostAddress();
$1 ==> "127.0.0.1"

  - Chuck

Reply via email to