6 Replies Latest reply on Sep 2, 2003 12:45 PM by kevin jiang

    Check port and host in remote interface

    kevin jiang Newbie

      Is there any way to check the host or port in the remote interface return by the container?

      Kevin

        • 1. Re: Check port and host in remote interface
          Weston Price Newbie

          Hello,
          Well, to get a reference to a Remote object you have to instantiate an InitialContext which has to have the host and port as properties. Could you describe what you are trying to do that would require this information. But in answer to your question, there is nothing in the EJB specification that allows for this. In fact, that is the point of EJB. location transparency.

          Regards,

          Weston

          • 2. Re: Check port and host in remote interface
            kevin jiang Newbie

            Thanks for the reply.

            We have a Swing applicaiton which connects to JBoss for our customer to do data entry. Since most of our customers are behind firewalls, I do some checks at startup to make sure the ports required to connect JBoss are not blocked. In my case, these ports are 1100 for JNDI lookup, 4444 for RMI port and 4445 for secured RMI port. If these ports are blocked, the application will not continue.

            Well, it has worked well until that MS blaster virus attack happened. Because of this virus, some Internet provider blocked traffic through 4444 and I got a lot of complaints about failing to connect to our server although their firewalls are open for the requried ports. In the mean time, since these ports are hard-coded in the client side, we can't change the ports on server side. Now I'm trying to avoid the hard-coded port number except the JNDI port in the client application so that I can change the ports on server side easily without changing the client application.

            In order to achieve this, I need to know the RMI port in the remote object returned by the JNDI look up and check if this port is blocked by the firewall. I tried to serialize the remote object and the host and port are there, but I can't find a programmable way to get these info.

            Regards,

            Kevin

            • 3. Re: Check port and host in remote interface
              Adrian Brock Master

              Why don't you use HTTP JNDI and invoker? Then you only
              have one port, the webserver.

              Regards,
              Adrian

              • 4. Re: Check port and host in remote interface
                kevin jiang Newbie

                Thanks for your suggestion.

                I have been struggling to make JNDI over http work but without success. I followed the instructions on "JBoss Administration and Development". Could you please kindly point out some examples or turorial on using these features.

                We're currently using JBoss 3.0.7, are all of JNDI, EJB and secure EJB over http supported on this version?

                Best Regards,
                Kevin

                • 5. Re: Check port and host in remote interface
                  Adrian Brock Master

                  Yes, and clustering.

                  There are examples in the testsuite if you can't figure it out.

                  Regards,
                  Adrian

                  • 6. Re: Check port and host in remote interface
                    kevin jiang Newbie

                    Finally JNDI and EJB access over http worked. My problem was that the port for JBoss servlet container has been modified to a different port other than 8080 and I still tried to connect to 8080.

                    Next step will be to check the performance impact due to http wrapping.

                    Thanks a lot.

                    Kevin