If it's failing against a remote machine then it's a sign that the authentication against the server during the connection creation is failing. I don't see in the code you posted any username and password that you are passing.
Jai , reading up at the various Jboss 7 documents i realised that due to the increased security I will need to provide a username / password combo . So i updated my code ( no longer using the jndi.properties file ) to send the user name password combo
final Hashtable jndiProperties = new Hashtable(); jndiProperties.put(Context.SECURITY_PRINCIPAL,"fxxxd"); jndiProperties.put(Context.SECURITY_CREDENTIALS, "c1795063026432fd040da7a6c73c0321"); jndiProperties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming"); InitialContext annuaireJNDI = new InitialContext(jndiProperties);
My question is that is the username /. password the same that is present in the mgmt.user.properties file on the server ?
Also my server is protected by a legitimate SSL certificate which also has a username password combo . Hence I am totally confused which one is the combo that i need to use here on the client side to connect .
Also reading about the properties of the jboss_ejb_client.protperites file @ Overview of Client properties - EJB Client Library (AS7+) - Project Documentation Editor i think i need to change
1) remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false to TRUE
2 ) remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false to TRUE
However currently i get the following exception :
- Could not register a EJB receiver for connection to remote://10.160.148.61:4447
java.lang.RuntimeException: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed
However if i set SSL_ENabled = true then I get an error - JBREM000200: Remote connection failed: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
Can you suggest anything . I feel confused regarding this