on 04-16-2007 3:55 AM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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>
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
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.