Memo su come ottenere InitialContext
JBOSS
.....
WAS
.....
JBOSS
....
import javax.naming.InitialContext;
import javax.naming.Context;
import javax.naming.NamingContext;
public static Context getInitialContext() throws javax.naming.NamingException
{
Properties p=new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
p.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
p.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");
p.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");
retutn new InitialContext(p);
}.....
WAS
....
import javax.naming.InitialContext;
import javax.naming.Context;
import javax.naming.NamingContext;
public static Context getInitialContext() throws javax.naming.NamingException
{
Properties p=new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.ejs.ns.jndi.CNInitialContextFactory");
p.put(Context.PROVIDER_URL, "iiop:///");
p.put(Context.PROVIDER_URL, "iiop:///");
retutn new InitialContext(p);
}.....
Nessun commento:
Posta un commento