Show TOC Start of Content Area

Procedure documentation Specifying Arbitrary JNDI Names for Your Beans  Locate the document in its SAP Library structure

Use

Caution

If you are accessing enterprise beans with J2EE clients (servlets, JSP, other enterprise beans, J2EE application clients), do not specify and use this arbitrary JNDI name. Instead, define EJB references in the clients’ deployment descriptors and access the beans using these references. For more information, see Declaring EJB References.

Caution

Specifying this arbitrary JNDI name when the bean’s clients are non-J2EE applications (such as WebDynpro applications, Enterprise Portal applications, and so on) is optional and should be used very carefully as this is the name with which the bean will be registered in the JNDI namespace and name conflicts may occur. This name must be unique among the names of all enterprise beans in all deployed applications and all other objects bound in the JNDI. Also, if you specify a prefix in the arbitrary JNDI name of your bean, this prefix must not coincide with the name of another object bound in the JNDI namespace.

 

By default the bean is bound in the JNDI namespace as <application provider>/<application name>/<EJB name>, where

·        <application provider> is the name of the application provider as specified in the <provider-name> element in application-j2ee-engine.xml

·        <application name> is the name of the application as specified in the <display-name> element in application.xml

·        <EJB name> is the name of the bean as specified in the <ejb-name> element in ejb-jar.xml.

This default JNDI name is the name that we recommend non-J2EE clients use to look up the bean.

In special cases, you can specify the arbitrary JNDI name. This name is specified in the ejb-j2ee-engine.xml.

Procedure

...

       1.      Open the ejb-j2ee-engine.xml.

       2.      From the Enterprise Beans tab, choose the corresponding tree structure according to the type of your enterprise bean your enterprise bean.

       3.      In the JNDI name field in the right-hand pane, specify the bean’s arbitrary JNDI name.

Result

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>.

 

 

End of Content Area