Hi,
I can access an ejb in Geronimo from a Java client like this:
ic = new InitialContext();
CustomerServiceHome sessionHome = (CustomerServiceHome) PortableRemoteObject
.narrow(ic.lookup("CustomerServiceRemoteHome"),
CustomerServiceHome.class);
session = sessionHome.create();
Customer c = session.findCustomer("1");
Now I'd like to do the same with Omniorb in C++.
Using the tutorial from http://www.yolinux.com/TUTORIALS/CORBA.html
I have
CORBA::Object_var naming_obj =
orb->resolve_initial_references ("NameService");
std::cout << "NameService resolved\n";
CosNaming::NamingContextExt_var naming =
CosNaming::NamingContextExt::_narrow (naming_obj.in ());
std::cout << "NameService narrowed\n";
CosNaming::Name name (1);
name.length (1);
name[0].id = CORBA::string_dup ("CustomerServiceRemoteHome");
CORBA::Object_var obj =
naming->resolve (name);
./a.out -ORBInitRef NameService=corbaloc::localhost:1050/NameService
The output is
NameService resolved
NameService narrowed
IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
So, has anybody an idea how to build a Corba name to access the EJB in Geronimo?
Thanks for any hints,
Juergen