-
30. Re: ejb access from one server to multiple servers
mohammadwrk Jun 18, 2013 12:00 PM (in response to jaikiran)Any plans to port this to EAP 6.X?
-
31. Re: ejb access from one server to multiple servers
jaikiran Jun 18, 2013 12:10 PM (in response to mohammadwrk)It's already in EAP 6.1
-
32. Re: ejb access from one server to multiple servers
jaikiran Jun 18, 2013 12:20 PM (in response to jaikiran)jaikiran pai wrote:
It's already in EAP 6.1
-
33. Re: ejb access from one server to multiple servers
mohammadwrk Jun 18, 2013 12:21 PM (in response to jaikiran)Thanks for the prompt response I'll give this a try.
Just wondering what's the challenge with propagating security context itself? We are in the process of migrating couple of applications from WebLogic to Jboss EAP and lack of this feature has caused us lots of boilerplate code!
-
34. Re: ejb access from one server to multiple servers
zeppelinux Jun 18, 2013 1:25 PM (in response to mohammadwrk)i was in the same situation (but migrated from as5 to as7), in my case it was easier because jboss (ok i get it - widlfly) users are good for applications where authentication initially done in one place and all the other time messages are used to care something that can be relied upon (token, signature or the whole user object). If you make that change everything else will be straightforward, but the next step will be probably enabling the secure ejb connection.
But yea, jaikirian is it on the radar somewhere? Audit records just need the username, roles support will be totall awesome (for those that don't have them yet;).
Message was edited by: Dmitry Shultz
-
35. Re: ejb access from one server to multiple servers
mohammadwrk Jun 18, 2013 4:45 PM (in response to mohammadwrk)I tried the "scoped client context" on jboss eap 6.1-final. It works as standalone client but fails for server-to-server communication!
On client-server I'm getting:
Caused by: java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling [appName:TestJbossSrv2SrvServerEjbEar, moduleName:TestJbossSrv2SrvServerEjb, distinctName:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@412301ca
at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:727)
at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:116)
at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:183)
at org.jboss.ejb.client.EJBInvocationHandler.sendRequestWithPossibleRetries(EJBInvocationHandler.java:253)
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:198)
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:181)
at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:144)
On destination-server I'm getting:
13:24:41,837 ERROR [org.jboss.remoting.remote.connection] (Remoting "centosvm1" read-1) JBREM000200: Remote connection failed: java.io.IOException: Received an invalid message length of -2140864253
Here is the code snippet for ejb lookup:
Properties ejbCtxProps = new Properties();
ejbCtxProps.put("remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED", "false");
ejbCtxProps.put("remote.connections", "default");
ejbCtxProps.put("remote.connection.default.host", "xx.xx.xx.xx");
ejbCtxProps.put("remote.connection.default.port", "4447");
ejbCtxProps.put("remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS", "false");
ejbCtxProps.put("remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT", "false");
ejbCtxProps.put("remote.connection.default.username", "user");
ejbCtxProps.put("remote.connection.default.password", "*****");
ejbCtxProps.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
ejbCtxProps.put("org.jboss.ejb.client.scoped.context", "true");
InitialContext jndiCtx = new InitialContext(ejbCtxProps);
MyServerEjbRemote bean = (MyServerEjbRemote)jndiCtx.lookup("ejb:TestJbossSrv2SrvServerEjbEar/TestJbossSrv2SrvServerEjb/MyServerEjb!com.mycompany.test.testjbosssrv2srvserverejb.MyServerEjbRemote");
return bean.getCallerName();
-
36. Re: ejb access from one server to multiple servers
mohammadwrk Jun 18, 2013 8:26 PM (in response to mohammadwrk)After further investigation (see the log below) it turned out that the root cause is "Class 'org.xnio.Options' not found" on the client-server. Adding https://github.com/wildfly/wildfly/blob/master/testsuite/integration/multinode/src/test/java/org/jboss/as/test/multinode/remotecall/scoped/context/MANIFEST.MF to the EJB jar did not solve the issue!
[33m17:13:45,943 WARN [org.xnio.option.parse] (EJB default - 1) Invalid option 'org.xnio.Options.SSL_ENABLED' in property 'remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED': java.lang.IllegalArgumentException: Class 'org.xnio.Options' not found
[0m [33m17:13:45,943 WARN [org.xnio.option.parse] (EJB default - 1) Invalid option 'org.xnio.Options.SASL_POLICY_NOPLAINTEXT' in property 'remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT': java.lang.IllegalArgumentException: Class 'org.xnio.Options' not found
[0m [33m17:13:45,944 WARN [org.xnio.option.parse] (EJB default - 1) Invalid option 'org.xnio.Options.SASL_POLICY_NOANONYMOUS' in property 'remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS': java.lang.IllegalArgumentException: Class 'org.xnio.Options' not found
[0m [31m17:13:46,217 ERROR [org.jboss.remoting.remote.connection] (Remoting "config-based-ejb-client-endpoint" read-1) JBREM000200: Remote connection failed: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
[0m [33m17:13:46,221 WARN [org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector] (EJB default - 1) Could not register a EJB receiver for connection to 10.0.2.159:4447: java.lang.RuntimeException: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
at org.jboss.ejb.client.remoting.IoFutureHelper.get(IoFutureHelper.java:91) [jboss-ejb-client-1.0.21.Final-redhat-1.jar:1.0.21.Final-redhat-1]
-
37. Re: ejb access from one server to multiple servers
zeppelinux Jun 18, 2013 8:40 PM (in response to mohammadwrk)do you use any jboss bom? looks like xnio 2 dependency is missing on the client, try to add it to the pom directly
-
38. Re: ejb access from one server to multiple servers
mohammadwrk Jun 18, 2013 9:00 PM (in response to zeppelinux)Error is in server side not client code
ClientEjb running inside server A is failing to lookup ServerEjb inside server B
-
39. Re: ejb access from one server to multiple servers
zeppelinux Jun 18, 2013 9:06 PM (in response to mohammadwrk)make sure you have tha same versions of xnio jar on client and server
-
40. Re: ejb access from one server to multiple servers
jaikiran Jun 18, 2013 11:20 PM (in response to mohammadwrk)Mohammad, could you please create a separate thread to discuss about the scoped EJB client context against EAP6, in the forum here https://community.jboss.org/en/jbosseap?view=discussions.
-
42. Re: ejb access from one server to multiple servers
zeppelinux Jun 20, 2013 5:32 PM (in response to jaikiran)Jaikirian, i'm curious about principal propagation, should we expect it sooner or later?
Mohammad, can you please post the whole stack trace? i'm still puzzled what's going on there... it worked for me when i used it from test client
-
43. Re: ejb access from one server to multiple servers
mohammadwrk Jun 20, 2013 5:43 PM (in response to zeppelinux)You can see the stack trace here https://community.jboss.org/message/823790#823790
-
44. Re: ejb access from one server to multiple servers
zeppelinux Jun 20, 2013 5:56 PM (in response to mohammadwrk)i don't think it' full stack, are there any lines below IoFutureHelper?