Hi
I tried to do what Sven says above... here is my code in a test JSP:
SessionOryBean sb = new SessionOryBean();
sb.ejbCreate();
out.println("
getSessionContext = "+sb.getSessionContext());
out.println("
getValue = "+sb.getValue());
javax.ejb.SessionContext ctx = sb.getSessionContext();
Object o = ctx.lookup("Ory_MenuBean");
Home aHome = (Ory_MenuHome)PortableRemoteObject.narrow(o, Ory_MenuHome.class);
// now we have a reference to a home with which we can find our data..
Ory_MenuBean aRemote = aHome.findByPrimaryKey(pk);
// now we have a remote
out.println("
getRes_id = "+aRemote.getRes_id());
-------------------------------------------
Cannot find the method called lookup(
String). Have I defined the session context ctx correctly?
-------------------------------------------
Here are the error I got:
com.ibm.servlet.engine.webapp.WebAppErrorReport: D:\Program Files\IBM\VisualAge for Java\ide\project_resources\IBM WebSphere Test Environment\temp\JSP1_0\default_app\_EJBTester_xjsp_jspsrc_1153903185.java:102: Method lookup(java.lang.String) not found in interface javax.ejb.SessionContext.
Object o = ctx.lookup("Ory_MenuBean");
^
D:\Program Files\IBM\VisualAge for Java\ide\project_resources\IBM WebSphere Test Environment\temp\JSP1_0\default_app\_EJBTester_xjsp_jspsrc_1153903185.java:103: Class Home not found.
Home aHome = (Ory_MenuHome)PortableRemoteObject.narrow(o, Ory_MenuHome.class);
^
D:\Program Files\IBM\VisualAge for Java\ide\project_resources\IBM WebSphere Test Environment\temp\JSP1_0\default_app\_EJBTester_xjsp_jspsrc_1153903185.java:103: Class Ory_MenuHome not found.
Home aHome = (Ory_MenuHome)PortableRemoteObject.narrow(o, Ory_MenuHome.class);
^
D:\Program Files\IBM\VisualAge for Java\ide\project_resources\IBM WebSphere Test Environment\temp\JSP1_0\default_app\_EJBTester_xjsp_jspsrc_1153903185.java:103: Undefined variable or class name: PortableRemoteObject
Home aHome = (Ory_MenuHome)PortableRemoteObject.narrow(o, Ory_MenuHome.class);
^
D:\Program Files\IBM\VisualAge for Java\ide\project_resources\IBM WebSphere Test Environment\temp\JSP1_0\default_app\_EJBTester_xjsp_jspsrc_1153903185.java:105: Class Ory_MenuBean not found.
Ory_MenuBean aRemote = aHome.findByPrimaryKey(pk);