Sven,
Specifying the properties in the constructor of InitialContext is portable
and necessary in cases when you are looking up a jndi resource from another
machine. The no-args constructor will get you the context of the appserver
you are running under. However if you needed to lookup a jndi resource on
another machine, or you are a stand-alone client app that needs to lookup
a jndi resource (such as an EJBHome), you will have to tell jndi what implementation
to use and the location of the resource. (Context.INITIAL_CONTEXT_FACTORY and
Context.PROVIDER_URL, respectively)
If you are worried about hardcoding the values, don't hardcode them, make them
data driven.
Chris
-----Original Message-----
From: sven [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 19, 2000 2:58 PM
To: [EMAIL PROTECTED]
Subject: InitialContext
I'm currently having a training for Weblogic and am having a discussion =
with my instructor on obtaining the initial context. I've been using =
Orion for a while and have some experience with IAS.
In my opinion, the weblogic way of obtaining the InitialContext using =
the InitialContext(Properties env) constructor is non-portable since =
deployment on any other Application Server would mean I have to =
recompile my EJB=B4s and client classes to point to the proper =
InitialContextFactory and Context.provider.URL. Both Orion and IAS allow =
to create the initial context using the no-arguments constructor.
Am I reading the specs wrong?
sven
===========================================================================
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".
===========================================================================
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".