search cancel

What can cause the error: Exception: - With the JNDI lookup of EJB from Java proxies?


Article ID: 54135


Updated On:


Gen Gen - Workstation Toolset Gen - Host Encyclopedia Gen - Run Time Distributed



When Installing Generated Java proxy in IBM Websphere , have problem to find JNDI lookup of EJB

An exception occurred calling Myserver.execute method


Description: [Function: EJBRMIDynamicCoopFlow.getHomeInterface]lookup("MYSERVER") threw: "javax.naming.NameNotFoundException: Context: basmu01cNode01Cell/nodes/basmu01cNode01/servers/server1, name: MYSERVER: First component in name MYSERVER not found. [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound:]" root cause: "org.omg.CosNaming.NamingContextPackage.NotFound:"


The problem is that when an EJB ear file is deployed, IBM WebSphere is building it's own EJB stub files. The Gen Proxy will need to use these WebSphere stub files instead of the Gen-generated _dpy files.
To get the Application to work, just add the location of the WebSphere-deployed EJB jar files to the Proxy's CLASSPATH. To get the JSP
sample to work, Add a Shared Library definition in WebSphere which also pointed to this location. Then in the Proxy application on WebSphere, you need to tell it to use this Shared Library and restart WebSphere to get this change to be picked up.

So the steps to get the Proxy JSP sample working are following:

  1. Deploy the EJB ear file on WebSphere.

  2. Find the location where WebSphere deployed the individual EJB jar files contained within the application's ear file. The location
    should be similar to:

    <Please see attached file for image>

    Figure 1

  3. Create a Shared Library in WebSphere, adding in any necessary EJB jar files from Step 2.


    <Please see attached file for image>

    Figure 2


    <Please see attached file for image>

    Figure 3

  4. Deploy the Proxy JSP sample ear file.

  5. Update the Proxy JSP sample application within WebSphere to use the Shared Library created in Step 3.


    <Please see attached file for image>

    Figure 4


    <Please see attached file for image>

    Figure 5

  6. Restart WebSphere.

  7. Run the Proxy JSP sample and it should work!


Component: Internet Client"


1558714039051000054135_sktwi1f5rjvs16tai.gif get_app
1558714037121000054135_sktwi1f5rjvs16tah.gif get_app
1558714034072000054135_sktwi1f5rjvs16tag.gif get_app
1558714032250000054135_sktwi1f5rjvs16taf.gif get_app
1558714030259000054135_sktwi1f5rjvs16tae.gif get_app