2 Replies Latest reply on Aug 13, 2002 6:16 PM by brendanl

    RMI/IIOP setup?

    fred_soulier

      Hi

      By default JBoss3.0.0 uses RMI/JRMP as defined in jboss-service.xml. How do I setup RMI/IIOP instead?

      Thanks.

        • 1. Re: RMI/IIOP setup?
          ratoo

          You just have to add in jboss.xml file:

          <configuration-name>IIOP Stateful SessionBean</configuration-name>

          tag (or your bean type). This tag will connect your bean to CORBA naming service. Don't forget, that by default you do not have iiop service activated - this activatid in "all" configuration, so you have to run jboss with "all" functionality. The another thing is how you connect to your bean from a client. Be sure to include jboss-iiop-client.jar in your client application, then you have to use jboss IOR, as your provider:

          look:

          ContextFactory = "com.sun.jndi.cosnaming.CNCtxFactory"
          ProviderURL = "IOR:000000000000002B49444C3A6F6D672E6F72672F436F734E616D696E672F4E616D696E67436F6E746578744578743A312E300000000000020000000000000068000102000000000E3139322E3136382E312E3131370021EB000000114A426F73732F4E616D696E672F726F6F74000000000000020000000000000008000000004A414300000000010000001C00000000000100010000000105010001000101090000000105010001000000010000002C0000000000000001000000010000001C00000000000100010000000105010001000101090000000105010001"

          THe IOR string must be obtained from jboss server.log. When it initialized in the log file you have

          Naming: [IOR: ... You have to get this IOR

          There is no need to change it every time you restart jboss since it remains the same untill you do not change the host.

          so here is excerpt of code:

          ******************************************
          Properties env = new Properties();
          env.put(Context.INITIAL_CONTEXT_FACTORY, factory);
          env.put(Context.PROVIDER_URL, provider);
          context = new InitialContext(env);
          *******************************************

          Another thing in a client part if you use Jacorb orb there is no need to compile stubs - it could be downloaded in request time, but if you use SUN java orb you have to compile your EJB interfaces with rmic -iiop compiler.

          Hope it will help

          • 2. Re: RMI/IIOP setup?
            brendanl

            Hi,
            I've followed all these instructions and unfortunately I am still in difficulty. I can create the InitialContext alright. But when I do any lookup (using a correct or even a false jndi name) I get the an org.omg.CORBA.MARSHAL exception with a minor code of 0!

            I am using 'belt and braces' here - I have jacorb.jar in my classpath but also the compiled stubs from rmic. I can't understand why I'm not simply getting a naming exception as the problem arises, as I say, in the ctx.lookup() - before I try to cast the result to any class!

            Any help would be very much appreciated.