private InitialContext getInitialcontext() throws NamingException
{
Properties env = new Properties();
try{
env.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
env.put(Context.PROVIDER_URL,"t3://localhost:7001");
}catch(Exception e){
System.out.print("Connection to the weblogic server is not there. " +
e );
}
return new InitialContext(env);
}
this is how u get the InitialContext for doing the jndi lookup.
here we have hard coded the url as "t3://localhost:7001"
but there is some way through which we can dynamically
know the servername
-
Can we dynamically know the servername? (1 messages)
- Posted by: vivek gupta
- Posted on: August 24 2000 12:57 EDT
Threaded Messages (1)
- Can we dynamically know the servername? by Jason Vasquez on August 31 2000 14:54 EDT
-
Can we dynamically know the servername?[ Go to top ]
- Posted by: Jason Vasquez
- Posted on: August 31 2000 14:54 EDT
- in response to vivek gupta
I dont' know if this works in weblogic or not, but in other EJB servers, you can place a file in the same directory as your executable called jndi.properties, which is basically a properties file that sets the values that you are setting explicitly here.