How to find the program name JNDI EJB programmatically?

I am using EJB 3.1 in my application.

I want to send one JNDI EJB name to my application to another application so that it can use it at runtime and communicate with my EJB. Since the search name depends on the name of the ear files deployed in the EJB container, and the name of these ear files will change every time any changes are made in my application.

What is the procedure for finding the return name of any EJB programmatically.

+5
source share
1 answer

First of all, I would not recommend this approach. Why don't you fix the JNDI names of your EJBs?

, InitialContext#list JNDI EJB. , . - ctx.list("") JNDI, , EJB. : EJB ejb.

. :

+4

All Articles