6 Replies Latest reply on Sep 24, 2003 12:51 PM by Jie Deng

    JBoss, RMI and firewall

    johnyb Newbie

      I have a problem.
      My server part uses JBoss and hosted on the computer begind the firewall. Client part uses RMI to get data from server and uses several ports that are opened for firewall. But if server restarted - JBoss returns new ports that are closed for firewall. How could I configure JBoss to setup ports that would be returned to client and would be opened? I mean the ports returned should be the same each time the client requests this ports to prevent JBoss allocating new (anonymous) ports when server restarted.

      ---
      Sincerely
      Johny B.

        • 1. Re: JBoss, RMI and firewall
          Juha Lindfors Master

          IIRC, RMIObjectPort attribute in your JRMP invoker (by default uses anonymous port, set it to a fixed port).

          HTH

          -- Juha

          • 2. Re: JBoss, RMI and firewall
            johnyb Newbie

            I am afraid it would not help. The ports that allocated simultaneously are used for exporting session beans. We need to hardcode these ports or to setup them in configuration if possible. The RMIObjectPort variable is set to 4444 value now, not anonymous. BTW, we using JBoss version 2.4. Any ideas?

            ---
            Sincerely
            Johny B.

            • 3. Re: JBoss, RMI and firewall
              Juha Lindfors Master

              Hmm, 2.4

              The JNDI uses RMI anonymous port IIRC. You should be able to config to a fixed port but I don't have 2.4 handy right now so can't check where the config is.

              -- Juha

              • 4. Re: JBoss, RMI and firewall
                Juha Lindfors Master

                Check NamingService MBean, RmiPort attribute (defaults to 0).

                -- Juha

                • 5. Re: JBoss, RMI and firewall
                  Jie Deng Newbie

                  I've seen similar message flying around quite bit but have not seen a positive confirmation on certain settings would work. I've tried Juhua suggestion by setting RmiPort (naming service mbean) to a fixed port and it does not seem to work. I still see the attempt to use anonymous port through firewall like you described here. What's your experience?

                  • 6. Re: JBoss, RMI and firewall
                    Jie Deng Newbie

                    Let me publish my findings for anyone else reference in case you ever bumped into same problem:
                    - First, I don't think you can tunnel directly through firewall using RMI. Even though you can assign the RMI port by using either RmiPort in the naming service or using jnp.properties (old 2.4 style). The JBoss server assign anounymous port anyway. This is probably below JBoss level at the default RMI implementation level.
                    -- To deal with the firewall problem use the HTTP runneling instead. I've successfully done that before in a pure client/server scenario. In currect project I happen to have the need to build server to server communication through JMX RMI connector.