Gaurav Agarwal wrote:
Properties properties = new Properties();
properties.setProperty("INITIAL_CONTEXT_FACTORY","org.jnp.interfaces.NamingContextFactory");
properties.setProperty("URL_PKG_PREFIXES","org.jboss.naming:org.jnp.interfaces");
properties.setProperty("PROVIDER_URL","jnp://localhost:1099");
properties.put(Context.SECURITY_PRINCIPAL, "avril");
Passing of security principal through jndi context properties will not work in AS-5. See Q10 (specifically the note about AS-5) in security FAQ http://community.jboss.org/wiki/SecurityFAQ