on 08-30-2016 9:59 AM
Hi,
I have an ejb with session bean and assosiated EAR where all methods are written with remote interface, I need to call this methods from a webdynpro java application from remote interface ( without creating the model by refering the EAR as dependency)
Something like this. ---
InitialContext ctx = new InitialContext();
String lookupString = "sap.com/Fact_EAR/Fact_EJBBean ";
Object obj = ctx.lookup(lookupString);
Fact_EJBHome ejbHome=(Fact_EJBHome)javax.rmi.PortableRemoteObject.narrow(obj, Fact_EJBHome.class);
Fact_EJB ejbBean=ejbHome.create();
int fact=ejbBean.Fact(5);
----
Once I get the ejbBean object from the sample code above I can get the methods from the bean which I created.
Please help.
Is there a reason why you cannot reference the ear? Otherwise you could try to do that with reflections to call your methods (i have never tried that before). Where exactly are you stuck? Does the lookup even work and you don't know how to access the methods?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I dont want to add the dependency of EAR in the webdynpro project and create the Model from EJB.
I want to use the remote interface and call the EJB methods from webdynpro application which is on the other server, like we call the adaptive webservice from EJB, in the same manner I want to call the remote interface and use the EJB methods in the webdynpro applicatioon.
I need help on how and where to use the JNDI name and other steps in the EJB project and the respective steps to call EJB methods in the Webdynpro application (Remote call).
Thanks
As I said i have never tried it myself but take a look at this:
Accessing Enterprise JavaBeans from Remote Clients - Developing Java EE 5 Applications - SAP Library
This should help to get the lookup working.
User | Count |
---|---|
93 | |
10 | |
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.