Bugs item #569305, was opened at 2002-06-15 07:35 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=376685&aid=569305&group_id=22866
Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Samuel Terrell (j3110) Assigned to: Nobody/Anonymous (nobody) Summary: Server IP detection causes problems Initial Comment: By default, on some Linux distributions, for performance and other reasons (some interfaces have dynamic IP's but the hosts ip shouldn't change), the host name of the local machine is configured to point to 127.0.0.1. When connecting through JNDI from a remote machine, the IP set in jndi.properties is overwritten with 127.0.0.1 on the client side. Obviously, this causes the client to fail connecting to the server. Other servers, Apache for example, warn the user that this is probably undesired behavior and allow a way to manually override the local IP with an option in the configuration files. ---------------------------------------------------------------------- >Comment By: Samuel Terrell (j3110) Date: 2002-06-19 07:59 Message: Logged In: YES user_id=563515 You would think that since you specify the IP in the jndi.properties file that the client could connect to the server, and it does for a brief moment. In that moment, apparently it retrieves the incorrect IP address from the JNDI server. The reason I say this is that I get a connection refused error on the client. It explicitly states that the error occurred while trying to connect to 127.0.0.1, and the error is thrown in the JNDI lookup of anything from a remote machine. I thought this was funny and set the server's host name to point to 1.1.1.1 in /etc/hosts, and it returned that address. As soon as I noticed this behavior, I was able to set the server's host name to point to the same IP as it is in the jndi.properties file. The client worked fine after I did so, but other users of JBoss probably will never notice this behavior, and thus, think that JBoss is to blame. Technically, JBoss should probably fail if it retrieves an IP in the 127.0.0.0/8 range, because it is certain to not work from remote machines. In the very least it should warn the unsuspecting administrator that he/she needs to fix the name resolution so that it doesn't end up with 127.0.0.1 for the host name. I'll leave the judgment of what the proper behavior should be up to someone else. I'm certain that this behavior wasn't intended as it causes remote connections to fail by default to a Linux server running JBoss. Basically, it isn't necessary that the server sends the IP address. In fact, if it didn't, this problem wouldn't occur. I have confirmed this behavior on several machines. If you want to see the behavior yourself: Set up JBoss on Linux. Type “hostname”. Edit /etc/hosts. Make sure the only line with the return of the “hostname” command is the same line as 127.0.0.1. Run JBoss on the server. Edit jndi.properties on the client machine (must be remote, not just different VM) . Set the IP to the proper IP of the server. Then try to run your client application. If you properly configured Linux, you won't have to check the “hostname” command against /etc/hosts, as it is the proper behavior of Linux to tell applications to use the local interface for local connections. The problem arises when servers like JBoss use this method of getting the IP to tell the client. You indeed will have the same problem from apache if the host name of the local system doesn't lookup via DNS, not the hosts file. But, when you have this problem from apache, it will say “Cannot find server name, using 127.0.0.1” as well as giving you a method for overriding this automatic detection mechanism in the configuration file. ---------------------------------------------------------------------- Comment By: Joao Pedro Clemente (jpcl) Date: 2002-06-18 19:35 Message: Logged In: YES user_id=169196 For what I've read from other J2EE platform manuals, I guess this happens 'cause of misuse of IP address. I'm not sure if I understood the failure cenario completely, but it seems that this would not happen if the client would use the server name instead of ip address. This is similar to some failures that happen when using a http proxy server that badly resolve dns names, if I'm not mistaken. Is it really necessary that the server sends the IP address to the client? Are you sure this is not a problem of your machines network configuration? Maybe you could give more details on your setup/machine configuration? ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=376685&aid=569305&group_id=22866 ---------------------------------------------------------------------------- Bringing you mounds of caffeinated joy >>> http://thinkgeek.com/sf <<< _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development