initialcontext and client global name fix
the clint can instanziate a new context without parameters thanks to gf-client.jar. Fixed also the ctx.lookup string
This commit is contained in:
@@ -14,25 +14,17 @@ public class client {
|
||||
|
||||
public static void main (String[] args) {
|
||||
|
||||
Properties props=new Properties();
|
||||
/*
|
||||
props.put("java.naming.factory.initial","com.sun.jndi.cosnaming.CNCtxFactory");
|
||||
props.put("java.naming.provider.url","iiop://localhost:3700");
|
||||
*/
|
||||
|
||||
props.setProperty(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
|
||||
props.setProperty(Context.PROVIDER_URL, "corbaname:iiop:localhost:3700");
|
||||
|
||||
Context ctx = null;
|
||||
try {
|
||||
ctx =new InitialContext(props);
|
||||
ctx =new InitialContext();
|
||||
} catch (NamingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
Object foo = null;
|
||||
try {
|
||||
foo = ctx.lookup("java:/global/web/store_class!test3_persistence.store_class_remote_interface");
|
||||
foo = ctx.lookup("java:global/web/store_class!test3_persistence.store_class_remote_interface");
|
||||
|
||||
} catch (NamingException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
Reference in New Issue
Block a user