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: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]" root cause: "org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0"
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:
- Deploy the EJB ear file on WebSphere.
- Find the location where WebSphere deployed the individual EJB jar files contained within the application's ear file. The location
should be similar to:
- Create a Shared Library in WebSphere, adding in any necessary EJB jar files from Step 2.
- Deploy the Proxy JSP sample ear file.
- Update the Proxy JSP sample application within WebSphere to use the Shared Library created in Step 3.
- Restart WebSphere.
- Run the Proxy JSP sample and it should work!