Hi,
You'll need to use getInitialContext() and provide the extra information if
your "stuff" is not all running on one box, one instance, otherwise you can
use new InitialContext(). The initial context is your entry point into the
naming systema and a particular namespace. You obtain your initial context
through an initial context factory. The factory uses the information you
provide it (the properties) to give you the correct initial context. For
example, if you application consists of servlet A making calls to EJB A you
can potentially be running both the servlet and EJB on one vendor server,
one instance; one vendor server, two instances (one for the servlet engine
and one for the EJB container); two vendor servers (vendor A servlet engine,
vendor B EJB container). You servlet would get an initial context, do the
EJB lookup and proceed with business. For the first scenario doing a new
InitialContext() should be fine. For the second and third scenarios you'll
need to provide the extra information. Hope that answers your questions.
--
Tinou Bao
www.baosys.com
----- Original Message -----
From: "Krishnaveni_mettu" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 18, 2001 3:04 AM
Subject: [EJB-INT] diff between getInitialContext() and new InitialContext()
Hi All,
Can nyone tell me the diff between getInitialContext() and new
InitialContext()?
For weblogic I define like this
public static Context getInitialContext() throws
javax.naming.NamingException{
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.TengahInitialContex
tFactory");
p.put(Context.PROVIDER_URL,"t3://CHNSHL14120:7001");
return new javax.naming.InitialContext(p);
}
what's the difference in container behavior in these 2 diff
conditions??
Thanks,
Krishnaveni.
=========================
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".