2 Replies Latest reply on Aug 31, 2006 1:38 PM by Dror Fries

    Unable to acces external Corba Object

    benoit villaumie Newbie

      Hello,

      I am unable to access an external Corba Object from an Ejb. The exception is :

      java.lang.UnsupportedOperationException
      at com.sun.corba.se.internal.ior.FreezableList.add(FreezableList.java:96)
      at com.sun.corba.se.internal.core.IOR.<init>(IOR.java:239)
      at com.sun.corba.se.internal.iiop.CDRInputStream_1_0.read_Object(CDRInputStream_1_0.java:652)
      at com.sun.corba.se.internal.iiop.CDRInputStream_1_0.read_Object(CDRInputStream_1_0.java:641)
      at com.sun.corba.se.internal.iiop.CDRInputStream.read_Object(CDRInputStream.java:253)
      at org.omg.CORBA.ObjectHelper.read(ObjectHelper.java:59)
      at org.omg.CosNaming._NamingContextExtStub.resolve(_NamingContextExtStub.java:400)
      at ui.ServerConnectionHandler.getCORBAObject(Unknown Source)
      ...
      


      However, when I execute my code inside a corba-client program (with a standard main function), everything works fine.

      Can someone help me or have some hooks ?

      ----------------------
      Here the ui.ServerConnectionHandler.getCORBAObject method

      
      private static org.omg.CORBA.Object getCORBAObject(String pServer, int pPort, String pComponent) {
      
      String orbArgs[] = {
       "-ORBInitialPort", String.valueOf(pPort),
       "-ORBInitialHost", pServer
      };
      
      org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(orbArgs, null);
      
      //client will use Naming Service
      org.omg.CORBA.Object o1 = orb.resolve_initial_references("NameService");
      
      org.omg.CosNaming.NamingContext nc = org.omg.CosNaming.NamingContextHelper.narrow(o1);
      
      //
      // Resolve names with the Naming Service
      //
      org.omg.CosNaming.NameComponent nc1 = new org.omg.CosNaming.NameComponent(pComponent, "");
      
      org.omg.CosNaming.NameComponent[] aName = {nc1};
      
      org.omg.CORBA.Object obj = nc.resolve(aName); // Exception Here !
      
      return obj;
      
      }