1 2 3 Previous Next 36 Replies Latest reply on Jul 18, 2006 12:36 AM by mcalexy2k Go to original post
      • 30. Re: Connection refused to host: 127.0.0.1
        bartvh

         

        "bartvh" wrote:
        "bartvh" wrote:
        The suggestion to remove `hostname` from the line starting with 127.0.0.1 in /etc/hosts is exactly the opposite as is suggested by for instance the GNOME desktop environment, postgresql, ... Would there be no other way that JBOSS can discover the ip address of the machine, thus not using the InetAddress.getLocalHost()? (By the way, the name of the method already suggests this will return the ip address of 'localhost' to me.)

        In the case of the connect back connection of jboss/mq OIL: the server can find out the address of the connecting client, just by inspecting the socket connection from that client. I would think the client does not need to send it's address to the server.


        • 31. Re: Connection refused to host: 127.0.0.1

           

          "juha@jboss.org" wrote:
          "juha@jboss.org" wrote:
          "juha@jboss.org" wrote:
          > Would there be no other way that JBOSS can discover the
          > ip address of the machine, thus not using the
          > InetAddress.getLocalHost()?

          What would you suggest to use instead?

          -- Juha


          • 32. Re: Connection refused to host: 127.0.0.1
            nmartel

             

            "nmartel@ll" wrote:
            "nmartel@ll" wrote:
            How you deal with the name resolution problem depends on one major element--a centralized IP-name resolution scheme.

            Do you use a NIS/DNS-managed addressing model? or Do you use a manually-managed addressing model?

            If you use a centrally-managed (NIS/DNS) model: then DO follow IETF best practices and enter all of your IP-host mappings at the NIS/DNS level. Avoid manual editing /etc/hosts since the local IP-host mapping information resolves a lookup before a network-based lookup happens--not usually what you want.

            If you use a locally-managed model: then do two main things. 1) Ensure that /etc/hosts contains as least a pair of entries a) The first maps "127.0.0.1 localhost" and the second entry b) maps "x.x.x.x local_host_name" where x.x.x.x is the assigned IP address and local_host_name is the assigned machine name. c) If you are really unsure, you can add a third entry mapping "127.0.0.1 local_host_name". (Entry c catches calls likely to be generated in a host lookup when early network services start up.)
            2) Adopt managing /etc/hosts from a central point. This means you adminisiter a centralized copy of the main body of the /etc/hosts file in one location.

            Step 2 is difficult because part of the complexity comes in how you push/publish the file to all of the participating machines. You need to pick up the standard body of IP-name mappings in each of the /etc/hosts files but at the same time you wish to preserve the first two or three IP-host mappings that are unique to a local host (such as "127.0.0.1 local_host_name"). You can manually edit/paste the same data into each /etc/hosts file OR you write an elaborate script to do the job. If the publishing job is too complex or labor intensive, then you are a candidate for a NIS/DNS model.

            To improve your success rate, pick one method or the other. A centrally-managed naming technique (either method described above) ensures that all nodes in a network have access to the latest and identical host/IP mappings. The evolution of NIS/DNS occurred as a result of the complexity of step 2 above that occurred once the Internet scope reached hundreds of nodes. You should really consider using NIS/DNS.

            Finally) If the proper IP-Host mappings are in place, JBoss generally starts without issue. If you feel unsure or haven't had any luck, take the advice from the JBoss group docs, start the service with the local_host_name as specified in the JBoss documentation (AND earlier in this thread).

            One last troubleshooting tip, ensure that you don't have firewall rules or filter settings that could block or alter your requests preventing your network-based IP-name resolution.






            • 33. Re: Connection refused to host: 127.0.0.1
              samilakka

               

              "SamiLakka" wrote:
              "SamiLakka" wrote:
              Try using, "jnp://192.168.1.40:1099/" instead of
              "jnp://192.168.1.40:1099" (note the final char).



              prop.put (Context.PROVIDER_URL, jnp://192.168.1.40:1099");



              • 34. Re: Connection refused to host: 127.0.0.1
                bindureddy

                 

                "bindureddy" wrote:
                "bindureddy" wrote:
                HI can anyone help me out please..
                I am very new to rmi and i wanted to run a server in the windows and whenever i amm trying to run it , it is giving me connection refused error..and i am not able to figure out this..i don't know anything about jboss too..i just happened to see this while i was searching for answer..
                start java -Djava.security.policy=policy -Djava.rmi.server.codebase=http://localhost:4106/myserver_dl.jar mathserver

                this is line used to run my mathserver..any changes to be done for this?
                thank you


                • 35. Re: Connection refused to host: 127.0.0.1
                  bartvh

                   

                  "bartvh" wrote:
                  "bartvh" wrote:
                  >
                  > What would you suggest to use instead?
                  >
                  > -- Juha

                  There is java.net.NetworkInterface, but that's only 1.4. And the API is not that wonderful. Still, you can check not to return the loopback address.



                  • 36. Re: Connection refused to host: 127.0.0.1

                    In your serverr ruuning on jboss server, you have to set hosts file entries corectly.

                    Sample


                    127.0.0.1 localhost
                    xxx.x.x.x yourservername yourservername.yourdomain

                    Assume your server ip is 192.168.123.3 and server name appsrv and domain is test.com then your hosts file must look like this

                    127.0.0.1 localhost
                    192.168.123.3 appsrv appsrv.test.com


                    Basically after setting your hosts file coretly, You should be able to ping your application sevrer using its name and it should reply correct ip address

                    Example

                    Ping appsrv
                    64 bytes from 192.168.123.3: icmp_seq=0 ttl=128 time=947 usec
                    64 bytes from 192.168.123.3: icmp_seq=1 ttl=128 time=393 usec
                    64 bytes from 192.168.123.3: icmp_seq=2 ttl=128 time=395 usec
                    64 bytes from 192.168.123.3: icmp_seq=3 ttl=128 time=395 usec
                    64 bytes from 192.168.123.3: icmp_seq=4 ttl=128 time=394 usec



                    1 2 3 Previous Next