14 Replies Latest reply on Dec 1, 2010 8:38 AM by peter craddock

    bind options

    peter craddock Novice

      I'm using 4.2.3 and I have an issue with connecting my client via RMI

       

      I wish to bind my server to the hostname so that the client can then use this information to connect back. If I do bind to host I notice that during startup the bisocker connector sets it self up using the ipaddress and a random port

       

      12:15:14,053 INFO  [ConnectionFactory] Connector bisocket://172.18.128.194:46844 has leasing enabled, lease period 10000
      milliseconds
      12:15:14,053 INFO  [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@fc9d2b started
      12:15:14,066 INFO  [ConnectionFactory] Connector bisocket://172.18.128.194:46844 has leasing enabled, lease period 10000
      milliseconds
      12:15:14,066 INFO  [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@57f57f started
      12:15:14,067 INFO  [ConnectionFactory] Connector bisocket://172.18.128.194:46844 has leasing enabled, lease period 10000
      milliseconds

       

      If I bind to ipaddress It binds to ipaddress on the expected port.

       

      What I want to do is bind to a hostname and the correct socket enableing my client to connect back via name and via the predefined ports we have opened in the firewall.

       

      If someone can tell me how these value are gererated I can alter the server config to match what I want.

       

      I have other servers setup that work as expected, the server at fault is in a different organisation so I need to give them guidlines on what needs to be changed.

       

      It is worth mentioning that the webservices starts as expected

       

      [WebService] Using RMI server codebase: http://efin_app01.adv.lan:8437/

        • 1. Re: bind options
          Yong Hao Gao Master

          You need to find your bisocket configure file and change the configuration entry:

           

          <attribute name="serverBindAddress">${jboss.bind.address}</attribute>

           

          replace the ${jboss.bind.address} with your host name.

           

          Or you can pass this parameter through command line when starting your jboss server, like

           

          ./run.sh -c <config> -b <hostname>

          • 2. Re: bind options
            Yong Hao Gao Master

            To specify the port, use

             

            <attribute name="serverBindPort">4457</attribute>

            • 3. Re: bind options
              peter craddock Novice

              I'am already binding to hostname and changeing the config prevents my server from deploying the application correctly. What I'm actually after is how it works out that it cant use the hostname and decideds to use the ipaddress and random port.

              • 4. Re: bind options
                Yong Hao Gao Master

                The serverBindPort is used for a client to connect to server, for a server replying to the client using a fixed port, you need

                 

                <attribute name="secondaryBindPort">xyz</attribute>                          
                <attribute name="secondaryConnectPort">abc</attribute>

                 

                Not sure if this are what you want.

                • 5. Re: bind options
                  peter craddock Novice

                  why do I have to alter the config I have 1 server that this works as expected on and another that it does not.

                   

                  The jboss config is the same on both servers I need to know why Jboss is binding differently, this must be down to the host os config.

                  • 6. Re: bind options
                    Yong Hao Gao Master

                    If both jboss server has same config, it must be your machine/os that causes the error. I usually check etc/hosts (for linux os) to see if they have some entries that need to be removed (or added).

                    • 7. Re: bind options
                      Yong Hao Gao Master

                      by the way, the log you gave is from JBoss Messaging, not RMI.

                      • 8. Re: bind options
                        peter craddock Novice

                        Yes I know the log is from JMS but I get the same type of error. The RMI is trying to connect via IP address rather than name on this server.

                         

                        If I get the log I provided displaying hostnames at startup I'm confident the RMI will also work.

                        • 9. Re: bind options
                          Andy Taylor Master

                          the JBM src looks up the remoting connector service and logs the info from there. Howard, do you know what version of remoting Pete needs to look at to debug?

                          • 10. Re: bind options
                            Yong Hao Gao Master

                            I'm not sure. Each version of JBM goes with a specific version of JBR. If Pete need to look at the remoting src, he need to check the version of JBM in the logs. Usually if the log level is TRACE, you can find the remoting version also in the logs.

                            • 11. Re: bind options
                              peter craddock Novice

                              Looks like the messageing code is calling

                               

                              String locatorURI = (String)JMXAccessor.getJMXAttributeOverSecurity(server, connectorObjectName, "InvokerLocator"); I need to find the code that creates the object this line is accessing.

                               

                              I have checked out the following source JBoss_4_2_3_GA so I should have the class I need to look at.

                              • 12. Re: bind options
                                Yong Hao Gao Master

                                I guess you are using JBoss MQ.

                                • 13. Re: bind options
                                  peter craddock Novice

                                  No we have JBoss_4_2_3_GA with JBossMessaging_1_4_2_GA I have no idea what version of Jboss Remoting is being used. The source I have checked out does not have InvokerLocator in it.

                                  • 14. Re: bind options
                                    peter craddock Novice

                                    I found that the remoting source being used is 2.2.2-SP8

                                     

                                    The problem was being cause by the name of the server redditch_efin_app01. Once the URI hasd been parsed the call to uri.getHost was returning null. I added an entry to the host file for redefinapp01 and restarted the appserver. The new URI was parsed correctly and the call to uri.getHost returned the correct value.

                                     

                                    Whilst trying to get to the bottom of this I found that the remoting code does not seem to use the default setting for remoting.bind_by_host

                                     

                                    String bindByHost = System.getProperty(BIND_BY_HOST, "True");

                                    byHost = Boolean.getBoolean(bindByHost); //this was false even thought the above string was 'True'

                                     

                                    I managed to fix this with a change of config but I did not seem to ba able to force a legacy parse or to bind by host.