You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Juergen Weber <we...@gmail.com> on 2007/12/10 23:22:05 UTC

Access a Geronimo EJB via Corba from C++ - how?

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

Re: Access a Geronimo EJB via Corba from C++ - how?

Posted by David Jencks <da...@yahoo.com>.
Without additional configuration your all-java example isn't using  
CORBA but rather the Openejb proprietary transport.

Are you sure you've configured everything so both geronimo and your c+ 
+ client are using the same name service?

Have you configured csiv2 security on the ejb with a TSSGBean and a  
<tss-link> element to it in the openejb plan?  Without this the ejb  
will not get bound in the corba name service.

thanks
david jencks

On Dec 10, 2007, at 2:22 PM, Juergen Weber wrote:

> 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