problem about remote ejb invoking in JBAS7.1
wutongjoe Feb 24, 2012 3:43 AMgood day all,
I have setup the AS 7.1 server using a modified standalone-full-ha.xml (modifications are listed below).I make some remote ejb calls to ejb running on the AS and saw some exceptions(colored red below):
======================================client logs below======================
2012-2-24 15:59:24 org.xnio.Xnio <clinit>
INFO: XNIO Version 3.0.3.GA
2012-2-24 15:59:24 org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.0.3.GA
2012-2-24 15:59:24 org.jboss.remoting3.EndpointImpl <clinit>
INFO: JBoss Remoting version 3.2.2.GA
2012-2-24 15:59:24 org.jboss.ejb.client.remoting.VersionReceiver handleMessage
INFO: Received server version 1 and marshalling strategies [river]
2012-2-24 15:59:24 org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver associate
INFO: Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext@186c730, receiver=Remoting connection EJB receiver [connection=Remoting connection <9934d4>,channel=jboss.ejb,nodename=joe-pc]} on channel Channel ID 8ca5bb4e (outbound) of Remoting connection 01e4853f to /127.0.0.1:4447
2012-2-24 15:59:24 org.jboss.ejb.client.remoting.VersionReceiver handleMessage
INFO: Received server version 1 and marshalling strategies [river]
2012-2-24 15:59:24 org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver associate
INFO: Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext@111b910, receiver=Remoting connection EJB receiver [connection=org.jboss.naming.remote.client.cache.ConnectionCache$ConnectionWrapper@1e1dadb,channel=jboss.ejb,nodename=joe-pc]} on channel Channel ID 91a7b2df (outbound) of Remoting connection 005b0668 to localhost/127.0.0.1:4447
2012-2-24 15:59:25 org.jboss.ejb.client.EJBClient <clinit>
INFO: JBoss EJB Client version 1.0.2.Final
2012-2-24 15:59:25 org.jboss.remoting3.remote.RemoteConnection handleException
ERROR: JBREM000200: Remote connection failed: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed
2012-2-24 15:59:25 org.jboss.remoting3.remote.RemoteConnection handleException
ERROR: JBREM000200: Remote connection failed: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed
2012-2-24 15:59:25 MainTest test
信息: hello: 1330070365026
2012-2-24 15:59:25 MainTest test
信息: hello: 1330070365116
=================config and code==============================
server side things below :
---------------------------------------standalone-full-ha.xml modifications---------------------
<security-realm name="ApplicationRealm">
<authentication>
<properties path="application-users.properties" relative-to="jboss.server.config.dir"/>
</authentication>
</security-realm>
....
<subsystem xmlns="urn:jboss:domain:remoting:1.1">
<connector name="remoting-connector" socket-binding="remoting" security-realm="ApplicationRealm"/>
</subsystem>
....
<security-domain name="my-security-domain" cache-type="default">
<authentication>
<login-module code="Remoting" flag="optional">
<module-option name="password-stacking" value="useFirstPass"/>
</login-module>
<login-module code="RealmUsersRoles" flag="required">
<module-option name="usersProperties" value="${jboss.server.config.dir}/application-users.properties"/>
<module-option name="rolesProperties" value="${jboss.server.config.dir}/application-roles.properties"/>
<module-option name="realm" value="ApplicationRealm"/>
<module-option name="password-stacking" value="useFirstPass"/>
</login-module>
</authentication>
</security-domain>
....
------------------------------------application-users.properties----------------------(passwd=123456)
myname=bd66e73f67b3a81bebf618ba2097210d
------------------------------------application-roles.properties----------------------
myname=testuserrole
------------------------------------HellowWorldImpl---------------------
@Stateless(name = "myname_test_hello")
@Clustered
@Remote(HellowWorldRemote.class)
@Local(HellowWorldLocal.class)
@SecurityDomain(value = "my-security-domain")
public class HellowWorldImpl implements HellowWorldRemote, HellowWorldLocal {
@RolesAllowed(value = { "testuserrole" })
public String hello(String name) {
String ret = "hello: " + name ;
log.info(ret + ",hashcode:" + hashCode());
return ret;
}
------------------------------server biz logs------------------------
...
INFO [com.biz.ejb.impl.HellowWorldImpl] (EJB default - 3) hello: 1330069243765,hashcode:16660345
...
==============================================
client side things below
----------------------------------------jboss-ejb-client.properties -------------------------
endpoint.name=client-endpoint
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
remote.connections=default
remote.connection.default.host=127.0.0.1
remote.connection.default.port = 4447
remote.connection.default.username=myname
remote.connection.default.password=123456
java.naming.provider.url=remote://localhost:4447
java.naming.factory.initial=org.jboss.naming.remote.client.InitialContextFactory
java.naming.factory.url.pkgs=org.jboss.ejb.client.naming
jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=true
jboss.naming.client.connect.options.org.xnio.Options.SASL_DISALLOWED_MECHANISMS=JBOSS-LOCAL-USER
jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT=false
----------------------------------ctx env setup code ------------------------------------------------
Properties props = new Properties();
props.load(EJBHomeFactory.class.getResourceAsStream("/jboss-ejb-client.properties"));
props.put(Context.SECURITY_PRINCIPAL, "myname");
props.put(Context.SECURITY_CREDENTIALS,
"123456");
props.put("jboss.naming.client.ejb.context", true);
context = new InitialContext(props);
----------------------------------client side invoking code --------------------------------------
HellowWorldRemote remo=(HellowWorldRemote)EJBHomeFactory.getInstance().lookup("ejb:/testEJB//myname_test_hello!com.biz.ejb.face.HellowWorldRemote", HellowWorldRemote.class);
log.info(remo.hello(Long.toString(System.currentTimeMillis())));
log.info(remo.hello(Long.toString(System.currentTimeMillis())));
================================end ======================
Question is , it seemed that I have successfully made calls two times to hello method but why do I have the following log on client side? (server side log shown no exceptions but normal biz logs).Anything wrong or missed for my server/client configurations? how to fix those SaslException ?
2012-2-24 15:59:25 org.jboss.remoting3.remote.RemoteConnection handleException
ERROR: JBREM000200: Remote connection failed: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed
thank you very much