Hello
I'm still facing the same issues with multiple calls to login module:
Here is the client code:
package com.asf.jndi.jboss7;
import java.rmi.RemoteException;
import java.util.Hashtable;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import com.asf.jboss7.RemoteCalculator;
import com.asf.kollecto.common.exception.AppException;
public class JndiTest {
public static void main(String[] args) throws NamingException,
AppException, RemoteException {
final Hashtable<String, Object> jndiProperties = new Hashtable<String, Object>();
jndiProperties.put(Context.URL_PKG_PREFIXES,
"org.jboss.ejb.client.naming");
jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jboss.naming.remote.client.InitialContextFactory");
jndiProperties.put(Context.PROVIDER_URL,
"remote://localhost:4447");
jndiProperties.put(Context.SECURITY_PRINCIPAL, "support");
jndiProperties.put(Context.SECURITY_CREDENTIALS, "1");
jndiProperties.put("jboss.naming.client.ejb.context", true);
jndiProperties
.put("jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT",
"false");
final Context context = new InitialContext(jndiProperties);
final String appName = "myear";
final String moduleName = "myejb3";
final String distinctName = "";
final String beanName = "CalculatorBean";
final String viewClassName = RemoteCalculator.class.getName();
String lookup = "ejb:" + appName + "/" + moduleName + "/"
+ distinctName + "/" + beanName + "!" + viewClassName;
System.out.println("lookup name: " + lookup);
RemoteCalculator facade = (RemoteCalculator) context.lookup(lookup);
System.out.println(facade);
for (int i = 0; i < 10; i++) {
System.out.println("test: " + facade.add(i, 8));
}
}
}
The login module is called for every remote call on that ejb.
I'm also attaching the ear, the standalone.xml file and the remote security jar that I add in the remoting module /home/servers/jboss-as-7.1.2.Final-SNAPSHOT/modules/org/jboss/as/remoting/main so I won't receive UUID as passwords.
This jar just contains a dummy login module that lets requests pass considering security will be done in other jaas.
I hope this will be enough not to consider this issue as closed.
Many thanks,
Daniel