geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Juergen Weber" <>
Subject Access a Geronimo EJB via Corba from C++ - how?
Date Mon, 10 Dec 2007 22:22:05 GMT

I can access an ejb in Geronimo from a Java client like this:

ic = new InitialContext();
CustomerServiceHome sessionHome = (CustomerServiceHome) PortableRemoteObject
session = sessionHome.create();
Customer c = session.findCustomer("1");

Now I'd like to do the same with Omniorb in C++.

Using the tutorial from

I have

  CORBA::Object_var naming_obj =
    orb->resolve_initial_references ("NameService");

    std::cout << "NameService resolved\n";

CosNaming::NamingContextExt_var naming =
      CosNaming::NamingContextExt::_narrow ( ());

      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

So, has anybody an idea how to build a Corba name to access the EJB in Geronimo?

Thanks for any hints,

View raw message