Difference between 'ns -DOAPort=1050' and 'start orbd -ORBInitialPort 1050'?

morven <[email protected]>
Newsgroups gmane.comp.corba.jacorb.devel
Message-ID <[email protected]>
Hi guys,

I'm totally new in Jacorb,excuse me if the question is stupid.

i have installed Jacorb on my laptop, and 'ns -DOAPort=1050' could be run
successfully via command line, but when i try to run my Java code as below,
i always get error says 'org.omg.CORBA.OBJECT_NOT_EXIST' on
orb.resolve_initial_references("NameService") invocation:

            Properties props = new Properties();
            props.put("org.omg.CORBA.ORBInitialPort", "1050");
            props.put("org.omg.CORBA.ORBInitialHost", "localhost");
            // 
            org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args, props);
            POA poaRoot =
POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
            poaRoot.the_POAManager().activate();
            GoodDayImpl impl = new GoodDayImpl();
            org.omg.CORBA.Object obj = poaRoot.servant_to_reference(impl);
            NamingContextExt nc =
NamingContextExtHelper.narrow(orb.resolve_initial_references("NameService"));
            nc.bind(nc.to_name("CorbaSample_Server"), obj);
            // 
            orb.run();

Then i google it, some guys say that i should use 'start orbd
-ORBInitialPort 1050' instead of 'ns -DOAPort=1050', i try it, and it DOES
work! there's no error any more when i run Java code.

So i'm curious to know what's the difference between these 2 commands? why
does 'ns' command cause problem?

Many thanks.
-- 
View this message in context: http://old.nabble.com/Difference-between-%27ns--DOAPort%3D1050%27-and-%27start-orbd--ORBInitialPort-1050%27--tp28546210p28546210.html
Sent from the JacORB - Dev mailing list archive at Nabble.com.


_______________________________________________
jacorb-developer maillist  -  [email protected]
https://lists.spline.inf.fu-berlin.de/mailman/listinfo/jacorb-developer
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.