cancel
Showing results for 
Search instead for 
Did you mean: 

Call J2EE application from Portal Application

Former Member
0 Kudos

Hey experts,

I am trying to call a J2EE application from a Portal application.

I am using the BonusCalculationEjb and BonusCalculationEAR downloaded from the web.

I have added a JNDI name sabbir/calculatorJNDI in BonusCalculationBean

Then, I have deployed BonusCalculationEAR and it deploys OK.

In the Portal application I have added the following PrivateSharingReference

<property name="PrivateSharingReference" value="SAPJ2EE::sap.com/BonusCalculationEar"/>

I am using the following code to call it

InitialContext ctx = new InitialContext();

BonusCalculatorLocalHome home = (BonusCalculatorLocalHome) ctx.lookup("localejbs/sap.com/sabbir/calculatorJNDI");

BonusCalculatorLocal theCalculator = home.create();

double result = theCalculator.calculateBonus(6);

out.println("The bonus is " + result);

But, I am getting the following error

Path to object does not exist at sabbir, the whole lookup name is localejbs/sap.com/sabbir/calculatorJNDI.

Can you please advise.

Thank you.

Accepted Solutions (1)

Accepted Solutions (1)

prashil
Advisor
Advisor
0 Kudos

Hi Sabbir,

Please try to edit the

<i>BonusCalculatorLocalHome home = (BonusCalculatorLocalHome) ctx.lookup("localejbs/sap.com/sabbir/calculatorJNDI");</i>

to

<i>BonusCalculatorLocalHome home = (BonusCalculatorLocalHome) ctx.lookup("/sap.com/sabbir/calculatorJNDI");</i>

Letme know what error you got!!!

Regards,

Prashil

Former Member
0 Kudos

Dear Prashil,

I tried that and got the following error.

Path to object does not exist at sabbir, the whole lookup name is sap.com/sabbir/calculatorJNDI.

Former Member
0 Kudos

Try <b>sabbir/calculatorJNDI</b>

You can find JNDI name in NetWeaver Administration of EJB module.

Help.sap.com:

<i>If you are accessing your beans locally, note that the local interface of the bean will be registered in the JNDI with a localejbs/ prefix in front of the JNDI name. That is, to look up your bean locally, use localejbs/<jndi-name>. To look up your bean remotely, use <jndi-name>.</i>

Vlado
Advisor
Advisor
0 Kudos

The exact lookup string in this case (to access the BonusCalculatorLocalHome from a Portal app) would be <b>"localejbs/sabbir/calculatorJNDI"</b> (as described <a href="http://help.sap.com/saphelp_nw04/helpdata/en/86/2ccbdefb8f5843958a11062e19fc1d/frameset.htm">here</a>). And "sabbir/calculatorJNDI" would give you the remote home interface.

Message was edited by:

Vladimir Pavlov

Answers (0)