tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andre Brito <>
Subject Can I lookup a different service from a service without @EJB?
Date Fri, 03 Jun 2011 17:57:57 GMT
Hey guys. The subject of this thread is ugly, I know. Pardon me, my english
is very poor.

I know I can use @EJB. Is simpler, easier and cleaner. But this question
appeared in the team. With JBoss, if I'm in SessionBean A and I need
SessionBean B, I must call the ServiceLocator. How can I do that with
OpenEJB? I tied this:

> // SessionBean A looking up SessionBean B
> Properties properties = new Properties();
> properties.setProperty(Context.INITIAL..., "RemoteInitialContextFactory");
> properties.setProperty(Context.PROVIDER_URL, "ejbd://");
> // is where the server is started, using openejb start
> --ejbd-bind.
> Context ctx = new InitialContext(properties);
> ctx.lookup("SessionBeanBRemote");

Apparently, it can't locate SessionBeanB. What am I doing wrong?

Thanks in advance,

View this message in context:
Sent from the OpenEJB User mailing list archive at

View raw message