Posts

Showing posts with the label jndi

Module path problem when looking for a remote EJB in JNDI

 When you encounter a "Module path problem when looking for a remote EJB in JNDI" issue in a Java EE application, it typically indicates a problem with the JNDI lookup path. Here are some steps to diagnose and resolve this issue: 1. **Verify JNDI Name:** Ensure that you are using the correct JNDI name to look up the remote EJB. The JNDI name is typically defined in the `ejb-jar.xml` or `glassfish-ejb-jar.xml` file and may have a format like `java:global/my-app/my-ejb/MyEJB!com.example.MyEJB`. 2. **Check Server Configuration:** Make sure the server configuration is correctly set up to host the remote EJB. Ensure the EJB module is deployed on the server. 3. **JNDI Lookup Code:** Verify that your JNDI lookup code in the client application is correct. It should include the full JNDI name used to locate the remote EJB. For example:    ```java    Properties properties = new Properties();    properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.glassfish.enterprise.iiop.api.Glas