cancel
Showing results for 
Search instead for 
Did you mean: 

Naming Problems with EJB when accessing from WebApplication

Former Member
0 Kudos

Hi all,

I'm trying to deploy an application consisting of several stateless session beans, one message driven bean and a web application. Everything works fine, until I try to log in (webapp). Then I get the following error:

com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Path to object does not exist at ik, the whole lookup name is ik/sec/IKAuthenticationEJB.

So the lookup name ik/sec/IKAuthenticationEJB is used in the code, whereas the JNDI Name of the requested bean is

sap.com/Integrationkernel/IKAuthenticationEJB (As showed in the Admin Tool). I'm wondering why there is this "sap.com" as I choosed a different name for the provider (But the error remains even if I change it to "sap.com").

As I cannot find any information about the "NameNotFoundException" I just tried the following:

- add a "ejb-ref" section to web.xml

<ejb-ref>

<ejb-ref-name>ik/sec/IKAuthenticationEJB</ejb-ref-name>

<ejb-ref-type>Session</ejb-ref-type>

<home>com.tsystems.ik.security.authentication.IKAuthenticationEJBHome</home>

<remote>com.tsystems.ik.security.authentication.IKAuthenticationEJBRemote</remote>

<ejb-link>sap.com/Integrationkernel/IKAuthenticationEJB</ejb-link>

</ejb-ref>

- add a web-j2ee-engine.xml to the Web Application:

<web-j2ee-engine>

<ejb-ref>

<ejb-ref-name>ik/sec/IKAuthenticationEJB</ejb-ref-name>

<jndi-name>sap.com/Integrationkernel/IKAuthenticationEJB</jndi-name>

</ejb-ref>

</web-j2ee-engine>

Does anybody know what to do? Did I declare the references in a wrong way?

Is there a complete API Javadoc available? I just found the very small one on SDN...

Thanks a lot,

Nadine

Accepted Solutions (1)

Accepted Solutions (1)

SvetoManolov
Employee
Employee
0 Kudos

Hi Nadine,

in order to lookup ab EJB from a web component you have to declare an ejb reference (ejb-ref section) in the web.xml. The jndi name in the web-j2ee-engine.xml can be omitted if you are sure that the information provided by the "ejb-ref" section is sufficient to identify the EJB component.

From the example you wrote I see that the ejb-link element is not correct. According to the EJB 2.0 FR specification (Appendix B, page 518) "ejb-link element must be the ejb-name of an enterprise bean". Probably this inconsistent information misleads the EJB Container in resolving the right reference.

My advice is simply to omit this and leave the "home" and "remote" elements. They should be enough.

A hint: you can use the "lsn" shell command from the "naming" group to observe the JNDI tree on a particular server node.

I hope this will help you.

Best regards,

Svetoslav

Answers (0)