Hi rick,

I believe you have to add the key (TNameService) for the corbaloc...

org.apache.yoko.orb.OB.BootManager bootManager = 
    org.apache.yoko.orb.OB.BootManagerHelper.narrow(
orb.resolve_initial_references("BootManager"));
bootManager.add_binding("TNameService", obj);

- Balaji



-----Original Message-----
From: Rick McGuire [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 10, 2006 7:27 AM
To: [email protected]
Subject: Resolving objects via corbaloc::

I've run into a bit of a roadblock trying to get my transient name 
service working, and I suspect it's because I'm missing some critical 
step some place.  In my test cases, I'm instantiating an ORB to host the

name service, intialized to listen on port 40001.  This ORB has an 
initial naming context activated on a POA instance using the following: 

    public void initialize(ORB orb) throws TransientServiceException {
        try {
            // get the root POA.  We're going to re
            POA rootPOA = (POA)
orb.resolve_initial_references("RootPOA");
            rootPOA.the_POAManager().activate();

            // we need to create a POA to manage this named instance, 
and then activate
            // a context on it.
            Policy[] policy = new Policy[3];
            policy[0] = 
rootPOA.create_lifespan_policy(LifespanPolicyValue.TRANSIENT);
            policy[1] = 
rootPOA.create_id_assignment_policy(IdAssignmentPolicyValue.SYSTEM_ID);
            policy[2] = 
rootPOA.create_servant_retention_policy(ServantRetentionPolicyValue.RETA
IN);

            POA nameServicePOA = rootPOA.create_POA("TNameService", 
null, policy );
            nameServicePOA.the_POAManager().activate();

            // create our initial context, and register that with the 
ORB as the name service
            initialContext = new TransientNamingContext(orb, 
nameServicePOA, null);
            
((org.apache.yoko.orb.CORBA.ORB)orb).register_initial_reference("NameSer
vice", 
initialContext.getRootContext());
        } catch (Exception e) {
            throw new TransientServiceException("Unable to initialize 
name service", e);
        }
    }


That all appears to be working correctly.  Now to run a tests, I 
initialize another ORB using the argument

        args = new String[] { "-ORBInitRef", 
"NameService=corbaloc::localhost:40001/TNameService"};

When I try to access the NameService using resolve_initial_references(),

I'm getting the following exception:

[server:err] org.omg.CORBA.OBJECT_NOT_EXIST: unable to dispatch - 
servant or POA
 not found  minor code: 0x4f4d0002  completed: No
[server:err]    at 
org.apache.yoko.orb.OB.Util.unmarshalSystemException(Util.jav
a:161)
[server:err]    at 
org.apache.yoko.orb.OB.GIOPConnection.processReply(GIOPConnec
tion.java:544)
[server:err]    at 
org.apache.yoko.orb.OB.GIOPConnection.processMessage(GIOPConn
ection.java:352)
[server:err]    at 
org.apache.yoko.orb.OB.GIOPConnectionThreaded.execReceive(GIO
PConnectionThreaded.java:460)
[server:err]    at 
org.apache.yoko.orb.OB.GIOPConnectionThreaded$ReceiverThread.
run(GIOPConnectionThreaded.java:58)

Is there some additional registration required to make TNameService 
accessible via a corbaloc: URL or is creating the TNameService POA 
sufficient?  I believe my server code is connecting with the name 
service ORB ok, since I was originally getting some connection failures 
until I sorted out getting the listener ports configured.  Now it looks 
like the two orbs are talking, but it's not able to resolve the context 
object.  I'm out of ideas on where to proceed from here.

Rick





Reply via email to