cancel
Showing results for 
Search instead for 
Did you mean: 

How to Invoke webdynpro java application of 7.31 in EJB through SAP Portal 7.31

Former Member
0 Kudos

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();

}

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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

Former Member
0 Kudos


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.

junwu
Active Contributor
0 Kudos

why not just put the code in ejb?

if you want to some rfc, you can write jco code in ejb..

Former Member
0 Kudos

Actually you can call Function Module form EJB itself.

Try this.

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0d5a6b6-0b4b-2d10-6daa-f8db89904...

Thanks,

Patralekha

Qualiture
Active Contributor
0 Kudos

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?

Former Member
0 Kudos

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

Qualiture
Active Contributor
0 Kudos

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

junwu
Active Contributor
0 Kudos

he even don't know ejb, what's the chance he knows CAF?