views:

470

answers:

1

Hi,

is there a way to get my stateless EJBs JNDI path? Supposing that I have written an EJB like this:

@Stateless public class BookBean implements IBookBeanLocal {

@Resource SessionContext sctx;

....

@PostConstruct public void afterInit(){ // sctx?? }

}

Is there a way do discover the BookBeans JNDI path during initialization? I need this to autosubscribe certain beans to a global registry during initialization. Are there any other ways to do so?

A: 

You could possibly write the jndi path you want in @Stateless annotation or xml ejb configuration and read that at runtime.

Finding out the auto-generated jndi path is troublesome.

Vitaly Polonetsky