1

We migrated from Jboss EAP 5 to EAP 6 in our development environment.

I now see the following in my JBOSS logs. I am trying to understand how this binding happens. I have read JBOSS docs on JNDI namespace binding. Still I am not totally clear how it works. Here is my log.

java:global/customerCare/services/UserDaoImpl!com.example.services.UserDao
java:app/services/UserDaoImpl!com.example.services.UserDao
java:module/UserDaoImpl!com.services.UserDao
java:global/customerCare/services/UserDaoImpl
java:app/services/UserDaoImpl
java:module/UserDaoImpl

Here are my EJBs

@Local
public interface UserDao {

    public static final String JNDI_NAME = "java:global/customCare/services/UserDaoImpl";

//interface methods here

}

@Stateless
public class UserDaoImpl implements UserDao {
// implement methods
}

My doubts are:

  1. I explicitly had JNDI binding to be java:global/customCare/services/UserDaoImpl in my UserDao interface. Then why do I see I binding for others such as app and module.

  2. what is the difference between app and module? when would binding to these components be needed? some example here to illustrate will be very helpful

  3. The last three lines of log show binding to UserDaoImpl. Is it something that JBoss does without I ask it to bind? ( I set only UserDao but not UserDaoImpl for JNDI binding).

I am a bit illiterate on JNDI Namespace binding. Reading docs helped me but not to great extent.

Thanks

brain storm
  • 30,124
  • 69
  • 225
  • 393

1 Answers1

1

I can answer doubt 2: All the names are the same thing but with different contexts.

The global name is a full JNDI context that is used to bind globally, ie. from a client or from another EAR file

The module name can be used to bind within the same application, ie different EJBs within the same EAR

The local name is used to bind locally, ie within an jar or war.

It is slightly more efficient to use the shorter names to bind locally than specifying a full global name each time.

From what I have seen JBoss EAP 6 will always list the three / six names for every enterprise bean during deployment. It is intended to help you as a developer identify the JNDI name(s) for the bean.

shonky linux user
  • 6,131
  • 4
  • 46
  • 73