[jboss-user] [EJB 3.0] - Re: Basic EJB - cant be invoked from client

jaikiran do-not-reply at jboss.com
Sun Apr 6 06:08:35 EDT 2008

"jeff.rosen" wrote : 
  | The problem is that he hasn't told the client where the naming provider is located.  One possible solution would be to modify the something like:
  |   | InitialContext ic = new InitialContext();
  |   | Context jndiRoot = (Context) ic.lookup("jnp://localhost:1099");
  |   | CalculatorLocal calculator = (CalculatorLocal)jndiRoot.lookup("CalculatorBean/local");
  |   | 
  | Assuming that JBoss is running on the same machine as the client, otherwise adjust the URL accordingly.

That actually is a good thing to try. All this while, i have been assuming that since localhost:1099 is the default URL that will be used by JBoss, he need not specify it as part of the InitialContext or jndi.properties. Probably pass all the JNDI related properties to the InitialContext constructor and see if that works:

  | 			Properties props = new Properties();
  | 			props.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
  | 			props.put(Context.PROVIDER_URL,"jnp://localhost:1099");
  | 			props.put(Context.URL_PKG_PREFIXES,"org.jboss.naming.jnp.interfaces");
  | 			Context ctx = new InitialContext(props);
  |                         ctx.lookup(.....);

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

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

More information about the jboss-user mailing list