11 Replies Latest reply on Jun 21, 2013 6:46 PM by Mohammad wrk Branched to a new discussion.

    JBoss EAP 6.1 and scoped EJB client context

    Mohammad wrk Newbie

      I used the following code snippet to lookup remote EJBs using new scoped EJB client context (https://access.redhat.com/site/documentation/en-US/JBoss_Enterprise_Application_Platform/6.1/html/Development_Guide/Using_Scoped_EJB_Client_Contexts.html) on JBoss EAP 6.1.0 Final.

       

      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();

       

      This code works fine for standalone clients but fails for server based clients (remote EJB lookup from server to server). As you can see from the server log below the client code inside the server fails to disable SSL on the outbound connection due to a class (org.xnio.Options) not found exception. Adding the required dependency directly to the MANIFEST.MF (https://github.com/wildfly/wildfly/blob/master/testsuite/integration/multinode/src/test/java/org/jboss/as/test/multinode/remotecall/scoped/context/MANIFEST.MF) file of the EJB module didn't 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]

        • 1. Re: JBoss EAP 6.1 and scoped EJB client context
          jaikiran pai Master

          What does your deployment packaging look like? Please post the exact contents of MANIFEST.MF and also post the output of:

           

           

          jar -tf <myapp>

           

          Replace <myapp> by whatever your deployment name is (for example: helloworld.ear)

          • 2. Re: JBoss EAP 6.1 and scoped EJB client context
            Wolf-Dieter Fink Master

            In this case you need to add a dependency to your ejb.jar, i.e. MANIFEST.MF use Dependencies: org.jboss.xnio.

            This is necessary to access the properties.

            In the jboss-client.jar this classes are included, but inside the server the classloader did not include it automatically.

            • 3. Re: JBoss EAP 6.1 and scoped EJB client context
              Mohammad wrk Newbie

              > jar -tf TestJbossSrv2SrvClientEjbEar.ear

              META-INF/MANIFEST.MF

              TestJbossSrv2SrvClientEjb.jar

              lib/TestJbossSrv2SrvServerEjb.jar

              META-INF/

               

              > more META-INF/MANIFEST.MF

              Manifest-Version: 1.0

               

               

              > jar -tf TestJbossSrv2SrvClientEjb.jar

              META-INF/MANIFEST.MF

              META-INF/

              META-INF/ejb-jar.xml

              com/

              com/mycompany/

              com/mycompany/test/

              com/mycompany/test/testjbosssrv2srvclientejb/

              com/mycompany/test/testjbosssrv2srvclientejb/MyClientEjb.class

              com/mycompany/test/testjbosssrv2srvclientejb/MyClientEjbRemote.class

               

              > more META-INF/MANIFEST.MF

              Dependencies: org.jboss.xnio

              • 4. Re: JBoss EAP 6.1 and scoped EJB client context
                jaikiran pai Master

                Please post the exact code in your client EJB code.

                • 5. Re: JBoss EAP 6.1 and scoped EJB client context
                  Mohammad wrk Newbie

                  /////////////////////////

                  MyClientEjb.java

                  /////////////////////////

                   

                  @PermitAll

                  @SecurityDomain("other")

                  @Stateless

                  public class MyClientEjb implements MyClientEjbRemote

                  {

                            @Resource

                            private SessionContext          context;

                   

                            @Override

                            public String getCallerName ()

                            {

                      String callerName = context.getCallerPrincipal().getName() + " : " + getRemoteCallerName();

                      System.out.println("===================== " + callerName);

                      return callerName;

                            }

                   

                   

                            public String getRemoteCallerName ()

                            {

                      try

                      {

                        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", "10.0.2.159");

                        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", "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();

                      }

                        catch (NamingException x)

                      {

                        throw new IllegalStateException(x);

                      }

                   

                   

                            }

                  }

                   

                   

                  /////////////////////////

                  MyServerEjb.java

                  /////////////////////////

                   

                  @PermitAll

                  @SecurityDomain("other")

                  @Stateless

                  public class MyServerEjb implements MyServerEjbRemote {

                   

                   

                            @Resource

                            private SessionContext context;

                   

                            @Override

                            public String getCallerName()

                            {

                                      String callerName = context.getCallerPrincipal().getName();

                                      System.out.println("===================== " + callerName);

                                      return callerName;

                            }

                  }

                  • 6. Re: JBoss EAP 6.1 and scoped EJB client context
                    Wolf-Dieter Fink Master

                    Seems the dependency is set for the wrong JAR, you need the dependency in the jar which is the ejb-module

                    • 7. Re: JBoss EAP 6.1 and scoped EJB client context
                      Mohammad wrk Newbie

                      It's set for TestJbossSrv2SrvClientEjb.jar which is the ejb-module.

                      • 8. Re: JBoss EAP 6.1 and scoped EJB client context
                        Wolf-Dieter Fink Master

                        Code Looks good,

                        does the quickstart helps? See MainEjbClient34App.class

                        You can clone the repository via git and follow the readme

                        • 9. Re: JBoss EAP 6.1 and scoped EJB client context
                          Mohammad wrk Newbie

                          Adding full stack trace

                           

                          13:24:42,624 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

                          13:24:42,625 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

                          13:24:42,626 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

                          13:24:42,901 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?

                          13:24:42,904 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]

                                    at org.jboss.ejb.client.remoting.ConnectionPool.getConnection(ConnectionPool.java:75) [jboss-ejb-client-1.0.21.Final-redhat-1.jar:1.0.21.Final-redhat-1]

                                    at org.jboss.ejb.client.remoting.RemotingConnectionManager.getConnection(RemotingConnectionManager.java:51) [jboss-ejb-client-1.0.21.Final-redhat-1.jar:1.0.21.Final-redhat-1]

                                    at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.setupEJBReceivers(ConfigBasedEJBClientContextSelector.java:130) [jboss-ejb-client-1.0.21.Final-redhat-1.jar:1.0.21.Final-redhat-1]

                                    at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.<init>(ConfigBasedEJBClientContextSelector.java:100) [jboss-ejb-client-1.0.21.Final-redhat-1.jar:1.0.21.Final-redhat-1]

                                    at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.<init>(ConfigBasedEJBClientContextSelector.java:68) [jboss-ejb-client-1.0.21.Final-redhat-1.jar:1.0.21.Final-redhat-1]

                                    at org.jboss.ejb.client.naming.ejb.EjbNamingContext.createIdentifiableEjbClientContext(EjbNamingContext.java:256) [jboss-ejb-client-1.0.21.Final-redhat-1.jar:1.0.21.Final-redhat-1]

                                    at org.jboss.ejb.client.naming.ejb.EjbNamingContext.setupScopedEjbClientContextIfNeeded(EjbNamingContext.java:123) [jboss-ejb-client-1.0.21.Final-redhat-1.jar:1.0.21.Final-redhat-1]

                                    at org.jboss.ejb.client.naming.ejb.EjbNamingContext.<init>(EjbNamingContext.java:98) [jboss-ejb-client-1.0.21.Final-redhat-1.jar:1.0.21.Final-redhat-1]

                                    at org.jboss.ejb.client.naming.ejb.ejbURLContextFactory.getObjectInstance(ejbURLContextFactory.java:38) [jboss-ejb-client-1.0.21.Final-redhat-1.jar:1.0.21.Final-redhat-1]

                                    at org.jboss.as.naming.InitialContext.lookup(InitialContext.java:101)

                                    at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:183)

                                    at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:179)

                                    at javax.naming.InitialContext.lookup(InitialContext.java:392) [rt.jar:1.6.0_38]

                                    at com.mycompany.test.testjbosssrv2srvclientejb.MyClientEjb.getRemoteCallerName(MyClientEjb.java:53) [TestJbossSrv2SrvClientEjb.jar:]

                                    at com.mycompany.test.testjbosssrv2srvclientejb.MyClientEjb.getCallerName(MyClientEjb.java:28) [TestJbossSrv2SrvClientEjb.jar:]

                                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_38]

                                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_38]

                                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_38]

                                    at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_38]

                                    at org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:58) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:58) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)

                                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:248) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:315) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:214) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.as.ejb3.remote.EJBRemoteTransactionPropagatingInterceptor.processInvocation(EJBRemoteTransactionPropagatingInterceptor.java:79) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.as.ejb3.security.AuthorizationInterceptor.processInvocation(AuthorizationInterceptor.java:122) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:76) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:55) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.invokeMethod(MethodInvocationMessageHandler.java:329) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.access$100(MethodInvocationMessageHandler.java:70) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler$1.run(MethodInvocationMessageHandler.java:203) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439) [rt.jar:1.6.0_38]

                                    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) [rt.jar:1.6.0_38]

                                    at java.util.concurrent.FutureTask.run(FutureTask.java:138) [rt.jar:1.6.0_38]

                                    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_38]

                                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_38]

                                    at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_38]

                                    at org.jboss.threads.JBossThread.run(JBossThread.java:122)

                          Caused by: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?

                                    at com.sun.net.ssl.internal.ssl.EngineInputRecord.bytesInCompletePacket(EngineInputRecord.java:152) [jsse.jar:1.6]

                                    at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readNetRecord(SSLEngineImpl.java:806) [jsse.jar:1.6]

                                    at com.sun.net.ssl.internal.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:721) [jsse.jar:1.6]

                                    at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:607) [jsse.jar:1.6]

                                    at org.xnio.ssl.JsseConnectedSslStreamChannel.unwrap(JsseConnectedSslStreamChannel.java:443)

                                    at org.xnio.ssl.JsseConnectedSslStreamChannel.read(JsseConnectedSslStreamChannel.java:484)

                                    at org.xnio.ssl.JsseConnectedSslStreamChannel.read(JsseConnectedSslStreamChannel.java:449)

                                    at org.xnio.channels.FramedMessageChannel.receive(FramedMessageChannel.java:87)

                                    at org.jboss.remoting3.remote.ClientConnectionOpenListener$Greeting.handleEvent(ClientConnectionOpenListener.java:151)

                                    at org.jboss.remoting3.remote.ClientConnectionOpenListener$Greeting.handleEvent(ClientConnectionOpenListener.java:143)

                                    at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72)

                                    at org.xnio.channels.TranslatingSuspendableChannel.handleReadable(TranslatingSuspendableChannel.java:189)

                                    at org.xnio.channels.TranslatingSuspendableChannel$1.handleEvent(TranslatingSuspendableChannel.java:103)

                                    at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72)

                                    at org.xnio.channels.TranslatingSuspendableChannel.handleReadable(TranslatingSuspendableChannel.java:189)

                                    at org.xnio.ssl.JsseConnectedSslStreamChannel.handleReadable(JsseConnectedSslStreamChannel.java:180)

                                    at org.xnio.channels.TranslatingSuspendableChannel$1.handleEvent(TranslatingSuspendableChannel.java:103)

                                    at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72)

                                    at org.xnio.nio.NioHandle.run(NioHandle.java:90)

                                    at org.xnio.nio.WorkerThread.safeRun(WorkerThread.java:208)

                                    at org.xnio.nio.WorkerThread.run(WorkerThread.java:121)

                                    at ...asynchronous invocation...(Unknown Source)

                                    at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:270)

                                    at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:386)

                                    at org.jboss.ejb.client.remoting.EndpointPool$PooledEndpoint.connect(EndpointPool.java:182) [jboss-ejb-client-1.0.21.Final-redhat-1.jar:1.0.21.Final-redhat-1]

                                    at org.jboss.ejb.client.remoting.NetworkUtil.connect(NetworkUtil.java:151) [jboss-ejb-client-1.0.21.Final-redhat-1.jar:1.0.21.Final-redhat-1]

                                    at org.jboss.ejb.client.remoting.NetworkUtil.connect(NetworkUtil.java:132) [jboss-ejb-client-1.0.21.Final-redhat-1.jar:1.0.21.Final-redhat-1]

                                    at org.jboss.ejb.client.remoting.ConnectionPool.getConnection(ConnectionPool.java:73) [jboss-ejb-client-1.0.21.Final-redhat-1.jar:1.0.21.Final-redhat-1]

                                    ... 71 more

                           

                           

                          13:24:42,926 INFO  [org.jboss.ejb.client] (EJB default - 1) JBoss EJB Client version 1.0.21.Final-redhat-1

                          13:24:42,939 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?

                          13:24:42,942 ERROR [org.jboss.as.ejb3.invocation] (EJB default - 1) JBAS014134: EJB Invocation failed on component MyClientEjb for method public abstract java.lang.String com.mycompany.test.testjbosssrv2srvclientejb.MyClientEjbRemote.getCallerName(): javax.ejb.EJBException: 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.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:165) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:250) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:315) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:214) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.as.ejb3.remote.EJBRemoteTransactionPropagatingInterceptor.processInvocation(EJBRemoteTransactionPropagatingInterceptor.java:79) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.as.ejb3.security.AuthorizationInterceptor.processInvocation(AuthorizationInterceptor.java:122) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:76) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:55) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.invokeMethod(MethodInvocationMessageHandler.java:329) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.access$100(MethodInvocationMessageHandler.java:70) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler$1.run(MethodInvocationMessageHandler.java:203) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439) [rt.jar:1.6.0_38]

                                    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) [rt.jar:1.6.0_38]

                                    at java.util.concurrent.FutureTask.run(FutureTask.java:138) [rt.jar:1.6.0_38]

                                    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_38]

                                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_38]

                                    at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_38]

                                    at org.jboss.threads.JBossThread.run(JBossThread.java:122)

                          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) [jboss-ejb-client-1.0.21.Final-redhat-1.jar:1.0.21.Final-redhat-1]

                                    at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:116) [jboss-ejb-client-1.0.21.Final-redhat-1.jar:1.0.21.Final-redhat-1]

                                    at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:183) [jboss-ejb-client-1.0.21.Final-redhat-1.jar:1.0.21.Final-redhat-1]

                                    at org.jboss.ejb.client.EJBInvocationHandler.sendRequestWithPossibleRetries(EJBInvocationHandler.java:253) [jboss-ejb-client-1.0.21.Final-redhat-1.jar:1.0.21.Final-redhat-1]

                                    at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:198) [jboss-ejb-client-1.0.21.Final-redhat-1.jar:1.0.21.Final-redhat-1]

                                    at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:181) [jboss-ejb-client-1.0.21.Final-redhat-1.jar:1.0.21.Final-redhat-1]

                                    at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:144) [jboss-ejb-client-1.0.21.Final-redhat-1.jar:1.0.21.Final-redhat-1]

                                    at $Proxy18.getCallerName(Unknown Source)          at com.mycompany.test.testjbosssrv2srvclientejb.MyClientEjb.getRemoteCallerName(MyClientEjb.java:54) [TestJbossSrv2SrvClientEjb.jar:]

                                    at com.mycompany.test.testjbosssrv2srvclientejb.MyClientEjb.getCallerName(MyClientEjb.java:28) [TestJbossSrv2SrvClientEjb.jar:]

                                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_38]

                                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_38]

                                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_38]

                                    at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_38]

                                    at org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:58) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:58) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)

                                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

                                    at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:248) [jboss-as-ejb3-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                                    ... 33 more

                          • 10. Re: JBoss EAP 6.1 and scoped EJB client context
                            jaikiran pai Master

                            Please try adding a jboss-deployment-structure.xml to the META-INF of the top level .ear file. In the jboss-deployment-structure.xml add a dependency for org.jboss.xnio for the EJB jar subdeployment. Here's some documentation on jboss-deployment-strucure.xml https://docs.jboss.org/author/display/AS72/Class+Loading+in+AS7. Let us know how it goes.

                            • 11. Re: JBoss EAP 6.1 and scoped EJB client context
                              Mohammad wrk Newbie

                              jaikiran pai wrote:

                               

                              Please try adding a jboss-deployment-structure.xml to the META-INF of the top level .ear file. In the jboss-deployment-structure.xml add a dependency for org.jboss.xnio for the EJB jar subdeployment. Here's some documentation on jboss-deployment-strucure.xml https://docs.jboss.org/author/display/AS72/Class+Loading+in+AS7. Let us know how it goes.

                              Thanks Jaikiran. Adding the following to the top level .ear file fixed the problem :-)

                               

                               

                              /////////////////////////////////////////////

                              jboss-deployment-structure.xm

                              /////////////////////////////////////////////


                              <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">

                                <sub-deployment name="TestJbossSrv2SrvClientEjb.jar">

                                  <dependencies>

                                    <module name="org.jboss.xnio" />

                                  </dependencies>

                                </sub-deployment>

                              </jboss-deployment-structure>