[jboss-user] [Security & JAAS/JBoss] - Re: Accessing a secure EJB from standalone Java client

Wolfgang Knauf do-not-reply at jboss.com
Tue Oct 28 09:18:26 EDT 2008

Those two lines are a bit strange:
InitialContext ctx = new InitialContext(env); 
  | InitialContext ctx = b.getInitialContext();
I guess, that line 60 is the one with the error?

Do you use an application client or a web client? For application clients, you MUST specifiy the JNDI connection properties on creating the InitialContext:
      Properties props = new Properties();
  |       props.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
  |       props.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming.client");
  |       props.setProperty(Context.PROVIDER_URL, "jnp://localhost:1099");
  |       InitialContext initialContext = new InitialContext(props);

Hope this brings us a bit further (though I am not really a professionel on JAAS)


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

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

More information about the jboss-user mailing list