on 09-27-2010 7:49 AM
Hi All,
I created a EJB DC project and trying to invoke through Webdynpro DC Project. I am using NWDS CE 7.11.
1. Entity Forwarding was enabled in EJB in Development Infrastructure.
2. Public part was added to ear
3. In webdynpro Dc project - the ear was added as the Dependency.
4. Add the ejb20 jar files to the DC Project External Libraries.
Context Initial_Context = new InitialContext();
InitialContext ctx = new InitialContext();
String Look_Up_String = "demo.sap.com/empname_ear/Empname_ejbBean";
obj = ctx.lookup(Look_Up_String);
Empname_ejbHome home = (Empname_ejbHome)javax.rmi.PortableRemoteObject.narrow(obj,Empname_ejbHome.class);
But when i write the code to get the Bean methods, i am unable to see the EJB Name.
empname_ejb localobject = home.create();
In the above line, i am unable to see "employeename_ejb" .
The Look Up string is correct as i got the JNDI Name from SAP NWA.
What else i required? Please do help me in this.
Thanks and Regards,
Divya
Plw
Used JPA and solved the issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Divya,
It seems that your EJB is not exposed as a public part.
Go to your ejbmodule.
Click on Windows->Show View->Development Infrastructure->Component Properties->Public Parts->Add the EJBs which you
want to expose to the other DC.
Hope this helps to solve the problem.
Regards,
Radhika
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Radhika,
I am able to see the Bean name and the Home,local and remote interfaces. But i cannot not able to see the EJB Name.
Is the procedure / code required for calling the EJB 3.0 inside webdynpro different for NWDS CE 7.11. Is there any tutorial available for this?
I even created a local ejb and webdynpro project. the same error.
Inside i gave webdynpro sharing reference, project reference , java build path - project and added the required external libraries. but still the same error.
Is there any other way to overcome this error.
Please do help me in this regard. I am stuck here.
Thanks,
Divya
Hi Divya,
Please refer to this document.
Just see if you missed any step
Hope it helps.
Regards,
Radhika
Hi Radhika,
Is this Invoking EJB through webdynpro cant be acheived by using the specified code.Is it not possible to use that Look Up Method in NWDS CE 7.11 . Here in this document they are creating a Enterprise Java Bean Model. Is it not possible to achieve this without using a model as we do in the older versions.
InitialContext ctx = new InitialContext();
String Look_Up_String = "demo.sap.com/empname_ear/Empname_ejbBean";
obj = ctx.lookup(Look_Up_String);
Empname_ejbHome home = (Empname_ejbHome)javax.rmi.PortableRemoteObject.narrow(obj,Empname_ejbHome.class);
empname_ejb localObject = home.create();
String name = localObject.getname();
java.util.ArrayList arrlist = localObject.getarrlist();
Is this way not possible?
Regards,
Divya
Hi Divya,
If you do not want to use the EJB Model import, you can still go for the method of Context lookup in web dynpro.
Please refer to the following wiki, which talks about connectivity to oracle database using EJBs. You can read it and apply the same logic for your requirement.
http://wiki.sdn.sap.com/wiki/display/WDJava/OracleConnectivitywithEJBusingWebDynproApplication
Regards,
Radhika
Edited by: Radhika Parag Rajopadhye on Oct 11, 2010 8:08 AM
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.