-
1. Re: Error connecting to ejb3 cluster
ablevine1 May 18, 2006 8:14 PM (in response to ablevine1)After trying several more permutations I finally got it to work with the ejbs by changing the line
socket://${jboss.bind.address}:3873
to
socket://my_ip:3873
in ejb3.deployer/META-INF/jboss-service.xml.
Then similary for jms, I had to update it in the file:
jms/uil2-service.xml
I noticed that the jboss.bind.address was always 0.0.0.0
I then looked in the jboss invoker code and noticed that in the case that the address passed into the invoker is 0.0.0.0 then it uses:
InetAddress.getLocalHost.getHostAddress()
to get the address to pass back to the session stub as the address to connect to. On many linux distributions, the above code gives the result 127.0.0.1 while on windows it will give you the actual ip address of the machine. I think that may have been why remote clients were attempting to connect to the loopback address.
Rather than setting the ip of the machine in each of the files, is there a way to just set jboss.bind.address?? -
-
3. Re: Error connecting to ejb3 cluster
ablevine1 May 24, 2006 5:02 PM (in response to ablevine1)upon further notice this seems that it may be primarily an issue with debian linux. When I tried the same set up on ubuntu linux, the jboss.bind.address resolved properly to the address of the machine instead of the loopback address. Has anyone else seen this happen?? Is there potentially something that I can fix in my linux configuration to result in the address being resolved correctly?? If this cannot be addressed then, once again, is there some way to set the jboss.bind.address variable??
-
4. Re: Error connecting to ejb3 cluster
tom.elrod May 26, 2006 10:55 PM (in response to ablevine1)You can either use the -b option for setting the bind address (e.g. >./run.sh -b 192.168.1.2) which will bind all network services to the specified address or set a system property for jboss.bind.address (for example, put -Djboss.bind.address=192.168.1.2 in the run.sh file). BTW, any alias found within a configuration xml file (such as ${jboss.bind.address}) can be set using system propreties.
-
5. Re: Error connecting to ejb3 cluster
ladobbins1 Jul 6, 2006 12:40 PM (in response to ablevine1)I have an interesting similar problem. We are setting the jboss.bind.address property in the run.sh (-Djboss.bind.address=${HOST_NAME}). Our Solaris machines have two ip address - one that is routed to a "data" network, another to an "admin" network. Our admins have configured ip aliases in the DNS that they want us to use instead of ip addresses. We set the HOST_NAME parameter in a script that calls run.sh depending on which machine we are deploying to.
On our development machine, the jboss.bind.address is getting set correctly - I can view the properties via the JMX console and see the property value.
On our other machines (test and prod), the jboss.bind.address comes up as 0.0.0.0. We are running JBOSS 4.0.1 SP1.
Why would the IP address be getting resolved on two of the machines, but not on the other? Any ideas? -
6. Re: Error connecting to ejb3 cluster
tom.elrod Jul 7, 2006 1:27 PM (in response to ablevine1)Just a guess, but sounds like dev machine and test/prod are using different script env (i.e. Solaris uses bourne shell, which I think needs -Djboss.bind.address=$HOST_NAME).
-
7. Re: Error connecting to ejb3 cluster
elkner Jul 7, 2006 2:18 PM (in response to ablevine1)Nope. On standard bourne shells "${HOSTNAME}" == "$HOSTNAME" is always true.
-
8. Re: Error connecting to ejb3 cluster
ablevine1 Jul 7, 2006 4:38 PM (in response to ablevine1)I've noticed that on my companies linux machines
(which are using debian sarge linux dist.), using the hostname does not work here. You need the IP address, otherwise it resolves to the loopback address and remote connections do not work. The only solution we could get to work was using the -b option followed by the machine's ip address. Meanwhile, on my home setup (which uses ubuntu linux) the hostname resolves just fine to the actual IP address of the machine with out needing to specify the IP address anyhwere in the config or startup.
Another difference that I noticed was that when things worked without specifying the ip address the following code would result in the actuall ip address of the machine:
System.out.println(InetAddress.getLocalHost().getHostAddress());
while on the machines where the hostname would not resolve properly the above code would result in the loopback address being returned.
This points to it being either a java security issue as noted in the java docs fot InetAddress.getLocalHost (although the java security settings for both of the different types of linux that I tested on appeared to be the same, yet with different localhost ip resolution results) or a machine setup issue or a difference in the Unix/Linux flavors being used. -
9. Re: Error connecting to ejb3 cluster
rhasselbaum Jan 9, 2007 9:54 AM (in response to ablevine1)Hi all,
I have encountered a similar problem on Ubuntu Edgy. I have a web app that listens for browser connections on port 8345. But apparently, it is binding to the loopback interface because I can only connect via "localhost" on the same machine.
I have tried specifying -Djboss.bind.address=<my_ip_address> at startup, but it does not seem to have any effect. And even if it did work, I need a solution that is DHCP-friendly because this is a development workstation.
Any ideas? For what it's worth, I'm running JBoss under Eclipse/JBoss-IDE, so I am specifying the jboss.bind.address as a VM argument in the launch configuration. I'm passing in other arguments there, too, so I know this technique works with other system properties. Also, I'm not running as root, if that makes any difference.
Help would be greatly appreciated! -
10. Re: Error connecting to ejb3 cluster
ash42 Jan 22, 2007 6:05 AM (in response to ablevine1)"rhasselbaum" wrote:
Using -b <your_ip> doesn't work either?
I have tried specifying -Djboss.bind.address=<my_ip_address> at startup, but it does not seem to have any effect. And even if it did work, I need a solution that is DHCP-friendly because this is a development workstation.
Anyway, it seems this problem is related to the /etc/hosts file on linux systems. In many installations I encountered the first line showed something like:127.0.0.1 localhost.localdomain localhost <your_hostname>
This is probably what makes JBoss bind itself to 127.0.0.1. If you want to change this behaviour, just edit /etc/hosts to resemble something like this:127.0.0.1 localhost.localdomain localhost <your_ip> <your_hostname>
This worked in all cases I encountered. Unfortunately I don't know how to fix this problem permanently when you're using DHCP, but I guess there is more information to be found on this subject on the Internet. Maybe just leave your hostname out of /etc/hosts?