Try using "org.jboss.security.jndi.LoginInitialContextFactory" for your java.naming.factory.initial property.
JBoss does not support passing this information in the environment. You must use a client side LoginModule...
While it is true that JBoss does not directly support passing this information in the environment, a workaround has been provided to mimic this mechanism. This is a quote from the JBoss documentation:
"Historically JBoss has not supported providing login information via the IntialContext factory environment. The reason being that JAAS provides a much more flexible framework. For simplicity and migration from other application server environment that do make use of this mechanism, JBoss-3.0.3 adds a new InitialContext factory implementation that allows this. JAAS is still used under in the implementation, but there is no manifest use of the JAAS interfaces in the client application.
The factory class that provides this capability is the org.jboss.security.jndi.LoginInitialContextFactory."
i got the same problem when trying to set up
Context.SECURITY_PRINCIPAL "..." with
Where can I found the org.jboss.security.jndi.LoginInitialContextFactory you mentioned, in my Jboss3.0.4 there is no such class?!
The said class is in the jbosssx.jar which you'll find in either the server/default/lib or server/all/lib directory.