On Tue, 28 Nov 2000 19:23:25 -0500, Prasenjit Mukherjee <[EMAIL PROTECTED]>
wrote:

>Hi,
>Do you need to have a jndi-name associated with an EJB? I dont see it in
>the specs, but most of the AppServers need one. In that case what does it
>mean to deploy an ejb without a jndi-name ?

Yes and no.

It depends on what you mean by JNDI name. The common understanding is
that this means "in an arbitrary client I can always do new
InitialContext().lookup("mybean");". And that is wrong. There is nothing
in the specs that mandate that this should be possible.

What they do mandate is that application components can access beans
through the java:comp/env namespace, which will contain all the links
that has been defined for the particular component. When I say component
I mean:
a) EJB component
b) servlet component
c) application client component

Note the use of the word "component". This means that it complies with
the rules of the J2EE specification with regard to packaging and
composition.

Specifically, this does *not* mean that a J2EE compliant application
client can look up an EJB component from a (minimally) compliant J2EE
EJB container.

However, if you take the same application client and package it as
defined in the J2EE specification, i.e. you add deployment descriptor
XML that defines what EJB components the client wants to access through
the java:comp/env namespace, then it can use JNDI to locate the EJB
component, and it will only have used features described in the J2EE
specification.

That said, it is *common* that EJB containers make deployed EJB
components available in the global namespace of the container. But, if
you only want to rely on the J2EE specification this is not something
that you can take advantage of.

So, to sum up:
No, J2EE/EJB does not mandate that deployed EJB components are bound in
the global JNDI namespace
Yes, J2EE/EJB mandates that EJB components should be made available to
all supported J2EE components through the java:comp/env namespace.

/Rickard

--
Rickard �berg

Email: [EMAIL PROTECTED]

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to