cancel
Showing results for 
Search instead for 
Did you mean: 

JNDI and EJB-Subcontext during lookup

Former Member
0 Kudos

Hi,

I have a kind of a problem with the lookup of a session bean during the JNDI-Lookup.

From using the JBOSS-Applicationserver a while ago I'm used to the following:

A bean with the jndi-name "TEST" can be looked up from a standalone client using this name "ejb/TEST".

But this does not work in the WEB AS 6.40. I always get a lookup failure, but when I use "TEST" alone it works.

I really want to place my EJB's under the Subcontext "ejb" and I want to look them up using "ejb/TEST".

So how can I achive this ?

Regards,

Frank

Accepted Solutions (1)

Accepted Solutions (1)

Vlado
Advisor
Advisor
0 Kudos

Hi Frank,

Unfortunately this isn't possible. The name "ejb" in the JNDI tree is reserved for internal use by the Web AS J2EE Engine. But you can place your EJB's in another subcontext, e.g. "myEjb" or "frankEjb". All you have to do is add that prefix in the <jndi-name> of your EJB's in the ejb-j2ee-engine.xml. Remember - EJB's are always registered under the exact name given in the <jndi-name> tag, or if there isn't such a tag - under <vendor-name>/<app-name>/<ejb-name>.

Best regards,

Vladimir

Former Member
0 Kudos

Hi,

thanks for your answer.

One more question:

So if i have a EJB called "TEST" (JNDI-Name) and this EJB has a local home interface I can lookup this bean using:

"localejbs/TEST" ?

Am I right with this assumption ?

Regards,

Frank

viliana
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Frank,

Yes, your assumption is correct. See also: http://help.sap.com/saphelp_nw04/helpdata/en/86/2ccbdefb8f5843958a11062e19fc1d/content.htm

Just to add to Vladimir's message, if you are using standard J2EE components and not remote clients to access your beans, it is not recommended to use the jndi-name defined in ejb-j2ee-engine.xml. Instead, in your clients' deployment descriptors you should declare references to the beans and access the beans using these references.

Best regards,

Viliana

Answers (0)