[jacorb-developer] Difference between 'ns -DOAPort=1050' and 'start orbd -ORBInitialPort 1050'?

morven huang_m_y at 163.com
Thu May 13 13:29:30 CEST 2010


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.




More information about the jacorb-developer mailing list