1 Reply Latest reply on Sep 5, 2003 5:34 AM by manu+

    Problems accessing a Forte/UDS IIOP service from a stateless

    manu+

      Hi there,

      I am trying to access an external IIOP service (in Forte/UDS application) using COS Naming service and JIDL from a stateles session-bean deployed in JBoss.

      This connection is successfull when running from a simple Java Client, but when trying the same from the session-bean I got an UnsupportedOperatingException.

      Here is the sample of code used by the simple java client:

      String defaultArgs[] = {"-ORBInitialPort", serverPort, "-ORBInitialHost", serverName};
      org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(defaultArgs, null);
      org.omg.CORBA.Object objNameService = orb.resolve_initial_references("NameService");
      NamingContext ctx = NamingContextHelper.narrow(objNameService);
      NameComponent nc1 = new NameComponent(serviceName, "text");
      NameComponent[] name1 = {nc1};
      org.omg.CORBA.Object obj = ctx.resolve(name1);



      The exception occurs when trying to resolve the name of the service I am requesting.

      Is there any configuation files I need to set to be able to link to the Forte/UDS IIOP server from within the deployed bean.
      If so where?

      Thanks a lot for your help,

      Manuela
      Luxembourg

        • 1. Re: Problems accessing a Forte/UDS IIOP service from a state
          manu+

          I investigated the problem further and it seems that problem occurs at the ORB initialization time (IOR.java sample with the constructor invoked)
          public IOR(InputStream s)
          {
          super( s ) ;
          this.factory = (ORB)(s.orb()) ;
          cachedCodebase = false;

          if (!is_nil()) {
          // If there is no codebase in this IOR and there IS a
          // java.rmi.server.codebase property set, we need to
          // update the IOR with the local codebase. Note that
          // there is only one instance of the local codebase, but it
          // can be safely shared in multiple IORs since it is immutable.
          if (uncachedGetCodeBase() == null) {
          JavaCodebaseComponent jcc = LocalCodeBaseSingletonHolder.comp ;
          if (jcc != null) {
          IIOPProfileTemplate temp = getProfile().getTemplate() ;
          temp.add( jcc ) ;

          codebase = jcc.getURLs() ;
          cachedCodebase = true;
          }
          }
          }

          makeImmutable() ;
          }


          where LocalCodeBaseSingletonHolder is an inner class of IOR.java defined as:

          private static class LocalCodeBaseSingletonHolder {
          public static JavaCodebaseComponent comp ;

          static {
          String localCodebase = JDKBridge.getLocalCodebase() ;
          if (localCodebase == null)
          comp = null ;
          else
          comp = new JavaCodebaseComponent( localCodebase ) ;
          }
          }


          In JDKBridge the localCodeBase returned is not null, this provokes a modification of the IIOPProfileTemplate of the IOR instance (whereas in the simple Java Applic it is null).

          This is the main difference I could find between the simple Java Applicaition and running in JBoss.

          The problem is that this property seems to be loaded by the RMIClassLoader when JBoss gets started.
          ("java.rmi.server.codebase" property).

          So is there a means to avoid the ClassLoader from loading this property??

          Thanks a lot for your help,

          Manuela