cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing EJBs from a Web project

Former Member
0 Kudos

Hi,

I am getting the error: "com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Path to object does not exist at java:comp, the whole lookup name is java:comp/env/ejb/UserInfoServer." when I try to access the session bean from my web project. I have followed the instructions explicitly in http://help.sap.com/saphelp_nw04s/helpdata/en/55/29ed5eff965448941c0b42f01b9804/frameset.htm and also tried every other combination I can think of for configuring the references in both the EJB project & the web project (both in the same ear). I do have a jndi name in the visual administrator for localebjs/sap.com/myEar/UserInfoServer. Does anyone have any ideas?

Thanks & merry Christmas/Happy New year to all the SDN folks!

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

I've managed to get around the problem for the time being by using "/localejbs/provider/application/beanName" - bypassing (I think) the whole JNDI issue - this is OK for now, but it's obviously not a long term fix.

Previously, I had used the default & so did not enter anything in the ejb-j2ee-engine.xml, and so my ejb's showed up nicely in the Visual Administrator JNDI Registry under the localejbs tab as you would expect. The problem appears to be in the Web project - The key is that the error is "Path to object not found" rather than "Name not found". It seems to me that it knows what it is looking for & that it is valid, but doesn't know how to get there! Note that the EJB project is in the same EAR. The only reference to "Path" that I can find is in the help doc above where it says "If the name of the target enterprise bean is not unique in the enterprise application scope, you can enter the path to the JAR file that contains the bean...". I've gone through the Car Rental Application pdf (I can't find the download that contains the entire application) & followed the instructions there explicitly for referencing ejbs from the web..

Former Member
0 Kudos

O.K.

There are 2 possibilities.

a) You use the exact name you have in your ejb JNDI.

This may be ejb/mybean...

b) You make sure you stick this into a resource ref and you name the resource ref java:comp/env/ejb/....

and use this in your context call.

Enjoy

Former Member
0 Kudos

This can be due to any problems in ejb-j2ee-engine.xml or ejb-jar.xml. Can you copy and paste the exact exception here?

Regards,

Anup.

Former Member
0 Kudos

Unfortunately, I do have java:comp/env/ejb/...

Any other ideas?

Former Member
0 Kudos

Hi,

How you have given the JNDI names? It should be given as-

ctx.lookup("java:comp/env/ejb/EmployeeDetails")

and this should not be like-

ctx.lookup("ejb/EmployeeDetails").

The first one is JNDI standard compliant and the second one is Weblogic compliant.

Regards,

Anup.

Note: If found useful, please contribute points.