[jboss-user] [JNDI/Naming/Network] - Re: javax.naming.NoInitialContextException: Can't find prope

kahzoo do-not-reply at jboss.com
Tue May 6 20:44:46 EDT 2008


InitialContext jndiContext = new InitialContext();
  | System.out.println("Now looking up session bean " + jndiName + " ...");
  | java.util.Hashtable properties = new java.util.Hashtable();
  | properties.put(Context.PROVIDER_URL,"localhost:1099");
  | properties.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
  | properties.put("java.naming.rmi.security.manager", "yes");
  | javax.naming.Context context = new javax.naming.InitialContext(properties);
  | Object beanHomeRef
  | = jndiContext.lookup(jndiName);
  | 

I wonder if the the last line really should be:

Object beanHomeRef
  | = context.lookup(jndiName);
  | 

because when you construct jndiConext, you're not passing the properties as argument:

InitialContext jndiContext = new InitialContext();

rather you do that for context,

javax.naming.Context context = new javax.naming.InitialContext(properties);
  | 


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4148986#4148986

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4148986



More information about the jboss-user mailing list