3 Replies Latest reply on Oct 16, 2003 1:24 AM by Bernd Zeitler

    RMI: Wrong address in Stub?

    t.beha Newbie


      I've a problem with rmi.
      This is the scenario:
      Client -> firewall(IP-converting) -> JBoss

      I've set the jndi.properties to
      java.naming.provider.url=http://[external machine address]:8080/invoker/JNDIFactory

      and also the external machine address in../deploy/http-invoker.sar/META-INF/jboss-service.xml
      http://[external machine address]/invoker/...

      the lookup works, but when I want to create the bean I get an Exception:
      RemoteException: java.rmi.ConnectIOException: Exception creating connection to:[internal IP adresse]; nested exception is:
      java.net.NoRouteToHostException: No route to host: connect.

      Why is in the Stub the internal IP-address?
      Have I somewhere forget the to set external IP?
      Does someone know the solution?

      best regard

        • 1. Re: RMI: Wrong address in Stub?
          Bernd Zeitler Expert

          The original exceptin is misleading ;-)

          Your are doing the JNDI lookup with HTTP because you want to pass through your firewall. This is ok. But then you are receiving the wrong stub (to use jboss terminology: you get the rmi invoker), which tries to call JBoss using RMI again. I think your firewall won't let you do this ;-)

          Search the forum (and JBoss examples) for an invoker using rmi over ssl. This should do the trick using JBoss from a client behind a firewall in a performant manner and opening only one specific port on your firewall. I think this is even mentioned in the JBoss doco.


          • 2. Re: RMI: Wrong address in Stub?
            t.beha Newbie

            thank you for the answer,
            but havn't I the same problem with external address? I found an example with ssl. This also use the RMPInvoker. Have I set there the external serveraddress? And when I set
            there the address, what is with the servlets (form the
            web-client), which also invoke the same bean? Get they the wrong adresse? They need the internal address, I think. Questions over questions....
            And if I can set two different Invokers for one bean,which is selected then?

            best regard

            • 3. Re: RMI: Wrong address in Stub?
              Bernd Zeitler Expert

              You don't have to mess around with any adress. You only need to configure an adress when you are looking for the InitialContext.
              With SSL you are using a special RMI Invoker, the RMI over SSL, which needs one port for SSL, not one dynamic (and optional one object) port.
              I really think the exception is kind of misleading.
              You can access the same bean with different invokers (if configured like this) by using different JNDI names when you do the bean lookup. You can configure this name with the invoker configuration.