WebLogic 10 T3InitialContextFactory

May 2, 2008 at 10:25 am (Uncategorized)

In order to invoke an EJB client, we need to invoke it through a context. As of following snippet
static public Context getInitialContext() throws Exception {
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY, “weblogic.jndi.T3InitialContextFactory”);
p.put(“java.naming.security.principal”,”weblogic”);
p.put(“java.naming.security.credentials”, “weblogic”);
p.put(Context.PROVIDER_URL, url);
return new InitialContext(p);
}

In order to use T3InitialContextFactory ${WL_Home}\server\lib\weblogic.jar should be added to the classpath for smooth working of the InitialContext

Advertisements

Permalink Leave a Comment