A better approach would be to use corbaname: URL format to look up the object. This tells the ORB the location of the naming service providing the object reference and which one you want. I believe the following would give you want you want:

   corbaname:10.11.12.13:4003/NameService#org/example/FooService

would do the lookup in on shot. It appears that the original error is caused by Yoko not liking the format of the corbaloc: URL you gave it. You might try explicitly specifying the iiop level in the URL:

  corbaloc:iiop:[EMAIL PROTECTED]:4003/NameService

Rick


Fredrik Jonson wrote:
Juergen Weber wrote:

 Try to use an IOR first(object_to_string() and friends)

Thank you! I now have working code!

I used the legacy code - that uses the default sun ORB - to
retrieve the IOR of the object I needed. After that it was as
simple as replacing:

 org.omg.CORBA.Object ns =
 orb.resolve_initial_references("NameService");
 NamingContextExt namingContext =
   NamingContextExtHelper.narrow(ns);
 org.omg.CORBA.Object obj = namingContext.resolve_str(
        "org/example/FooService");

Whith these two lines:

        String ior = "IOR:000000000000003f4..."
        org.omg.CORBA.Object obj = orb.string_to_object(ior);

And now everything works in Geronimo too... Yay!

I must admit that it's still a bit magic to me, I mean why that
change made a difference in the first place. A bit of browsing
on the web suggests that using IOR is a more ORB-independent
way of getting hold of a service, but I'm not sure that's the whole story?

Anyway, thanks again Juergen!


Reply via email to