on 12-20-2013 6:33 AM
I have developed a Web Dynpro Java Application & the requirement is it should run in background daily in Sap Portal 7.31
For this We have developed a Web dynpro java 7.3 application & created a EJB project for scehduliong job in portal.
Application is working properly & EJB project is working properly,but when we add Web dynpro java application in EJB project & scehdule in portal .it si giving an error.
Once the Application runs on schedule it is giving an "Error" as the Status
This is the code in EJB ,but it is not working...]
public void onJob(JobContext jobContext) throws Exception
{
InitialContext ctx = new InitialContext();
String lookupString = "company.com~grpassign.ear";
Object obj = ctx.lookup(lookupString);
TestComp ejbHome = (TestComp)javax.rmi.PortableRemoteObject.narrow(obj,TestComp.class);
Grpassign ejbHome = (Grpassign)javax.rmi.PortableRemoteObject.narrow(obj,Grpassign.class);
ejbHome.wdDoInit();
}
Hi Nisha,
Can you try to use "<sap.com/your ear file name/your Bean name>" while taking the lookupString.
As you are taking upto ear file.Please take the Bean as well.
Sample code:
try
{
InitialContext ctx = new InitialContext();
String lookupString = "<sap.com/your ear file name/your Bean name>";
String lookupString = "sap.com/xxx/xxxBean ";
Object obj = ctx.lookup(lookupString);
TestComp ejbHome = (TestComp)javax.rmi.PortableRemoteObject.narrow(obj,TestComp.class);
TestComp testEJB = ejbHome.create();
int someMethodResult=testEJB.SomeMethod("xx");
}
catch(Exception e)
{
e.toString();
}
Thanks,
Patralekha Sur
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
i tried this code but job runs well but no result.
i didnt get this in your code
int someMethodResult=testEJB.SomeMethod("xx");
kindly give some example.?
Currently I have written code in Webdynpro java 7.3 in code i have binded it with function module.
how to do the same in EJB.
Can you provide me some links.
Actually you can call Function Module form EJB itself.
Try this.
Thanks,
Patralekha
What exact exception do you get?
Please note a Web Dynpro Java application is not intended to run without a (web) user interface (for instance, when called from a scheduler)
Since you don't have a user interface, why not simply leave your logic in the EJB project, or even better, in a CAF project?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Robin,
I am New to EJB,i am a web dynpro Java consultant.
In Web dnypro java in code i have binded it with function module.
how to do the same in EJB.
Message was edited by: Ervin Szolke General Abuse: Please do not provide your email directly in posts. I have removed the link. Regards, Ervin (moderator)
Message was edited by: Ervin Szolke
I would create a CAF project. Under 'external' node, import your RFC.
Create default mapping from context menu, using a new application service. The resulting ejb/ear can be used for scheduling
See also SAP Library - SAP NetWeaver Composition Environment Library
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.