2 Replies Latest reply: Jun 9, 2012 5:35 PM by REDO LOG RSS

    Corba  namingcontext

    REDO LOG
      Hi all
      I have programmed a corba server using the nameservice but had problem at orb.resolve_initial_references("NameService")

      here is the program:


      package hello;
      import org.omg.CosNaming.*;
      import org.omg.CosNaming.NamingContextPackage.*;
      import org.omg.CORBA.*;
      import org.omg.PortableServer.*;
      import org.omg.PortableServer.POA;

      import java.util.Properties;

      public class Server{

      public static void main(String args[]){
      try{

           
           java.util.Properties props = System.getProperties();
      props.put("org.omg.CORBA.ORBClass", "com.ooc.CORBA.ORB");
      props.put("org.omg.CORBA.ORBSingletonClass",
      "com.ooc.CORBA.ORBSingleton");
                     
      ORB orb = ORB.init(args, props);
           
           NamingContext nc = NamingContextHelper.narrow(orb.resolve_initial_references("NameService"));/* here where the problem occurs, and exactly the at
      orb.resolve_initial_references("NameService")*/
           
           Hello_impl helloimpl = new Hello_impl();
           Hello hello = helloimpl._this(orb);
           
           NameComponent[] path = new NameComponent[1];
           path[0] = new NameComponent();
           path[0].id = "Hello";

      nc.rebind(path,hello);
           orb.run();
      }

      catch (Exception e){
      System.err.println("ERROR: " + e);
      e.printStackTrace(System.out);
      }

      System.out.println("HelloServer Exiting ...");
           
      }
      }


      thanks for help
        • 1. Re: Corba  namingcontext
          EJP
          Your question is a complete waste of time, as you have failed to tell us what problem you are having.
          • 2. Re: Corba  namingcontext
            REDO LOG
            Hi
            thanks for responding

            the error is:



            ERROR: org.omg.CORBA.ORBPackage.InvalidName
            org.omg.CORBA.ORBPackage.InvalidName
            at com.ooc.OB.InitialServiceManager.resolveInitialReferences(InitialServiceManager.java:192)
            at com.ooc.OBCORBA.ORB_impl.resolve_initial_references(ORB_impl.java:1170)
            at hello.Server.main(Server.java:23)
            HelloServer Exiting ...