on 03-23-2006 6:47 AM
Hello,
Can some one tell me how I can access an EJB from a JSP Dynpage.
Best Wishes,
John.
Message was edited by: John Bray
Hi John,
This <a href="http://help.sap.com/saphelp_nw04/helpdata/en/88/bdfc3f48ecc742e10000000a1550b0/frameset.htm">link</a> will help u..
Or try doing these steps:
1) Create the ejb & pack it into an ear. Give a JNDI name for the ejb, let's call it My_JNDI. Deploy the ear.
(For specifying the JNDI name through NWDS, in J2EE perspective of the NWDS, double click on ejb-j2ee-engine.xml file. select your bean from the right side view and then specify a Jndi name)
2) Create the Portal project, select the EAR project in the project references. Select the EJB project in JavaBuildPath->Projects and JavaBuildPath->Order&Export.
3) Write the following lines of code to call the ejb method.
InitialContext context = new InitialContext();
Object Obj = context.lookup("MY_JNDI");
<Bean_name>Home home = (<Bean_Name>Home)javax.rmi.PortableRemoteObject.narrow(Obj,<Bean)_name>Home.class);
<Bean_name> bean = home.create();
// call the bean method ....bean.<method>();
4) Edit your portalapp.xml. Add the following line of code in your <application-config> tag.
<property name="PrivateSharingReference" value="SAPJ2EE::sap.com/MyEAR_Project"/>
5) Run your application.
Before you run your application, you may check if the ear has been deployed correctly:
1) Open Visual Administrator, Go to Server->Deploy. Select application & make sure the service sap.com\<your_EAR_name> is running. You can find the bean inside the Ejb_Container of this service.
2) In Visual Admin, go to Server->JNDI Registry. Verify that you have your JNDI name listed directly under the Regisrt and also under 'ejbCosNaming'.
Regards,
Pooja.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi John,
Try this <a href="https://www.sdn.sap.com/irj/sdn/thread?threadID=118739">thread</a>.
See this <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/b0/2beb7a371c4649b2ceec901248ef31/frameset.htm">link</a> also.
Regards,
Pooja.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.