8 Replies Latest reply on Jul 10, 2015 9:31 AM by jaikiran

    Remote EJB call from EAR to EAR using database login module

    christian-sandborg

      Hello, we are upgrading some of our systems from JBoss EAP 5.2 to EAP 6.4. We have two different EAR applications deployed on different servers. One of the applications (EAR A) does remote EJB calls to the other (EAR B) using the credentials (username and password) from the currently logged in user. It automatically logs in to the security realm on EAR B which uses a database login module. On EAP 5.2 the setup was very simple, the client code looked something like this:


      ...

      props.put(Context.INITIAL_CONTEXT_FACTORY,

                      PropertyLoader.getProperty("org.jboss.security.jndi.JndiLoginInitialContextFactory"));

      props.put(Context.PROVIDER_URL, "jnp://12.13.14.15:1199");

       

      props.put(Context.SECURITY_PRINCIPAL, session.getUsername());

      props.put(Context.SECURITY_CREDENTIALS, session.getPassword());

       

      InitialContext ic;

      ic = new InitialContext(props);

       

      String lookupString = PropertyLoader.getProperty(ConnectHelper.SYSTEM_REMOTE_CONTEXT_NAME) + "/"

                          + ejbClass.getSimpleName() + "/" + ConnectHelper.REMOTE_LOOKUP_SUFFIX;

      remoteEjb = (T) ic.lookup(lookupString);

      ...

       

      This worked perfectly. Now we have problems achieving the same behavior on EAP 6.2 with calls from EAR A to EAR B. But we did write a small test java standalone application and from that one we can perfectly simulate A and get it to work, it looks something like this:

       

                final Hashtable<Object, Object> contextProperties = new Hashtable<Object, Object>();

       

              contextProperties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");

              contextProperties.put("jboss.naming.client.ejb.context", true);

       

              final Properties ejbProperties = new Properties();

              ejbProperties.put("remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED", "false");

              ejbProperties.put("remote.connections", "1");

              ejbProperties.put("remote.connection.1.host", "localhost");

              ejbProperties.put("remote.connection.1.port", "4447");

              ejbProperties.put("remote.connection.1.username", "anExampleUser");

              ejbProperties.put("remote.connection.1.password", "aPassword");

       

       

              ejbProperties.put("remote.connection.1.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS", "true");

              ejbProperties.put("remote.connection.1.connect.options.org.xnio.Options.SASL_DISALLOWED_MECHANISMS",

                      "JBOSS-LOCAL-USER");

              ejbProperties.put("remote.connection.1.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT", "false");

       

              final EJBClientConfiguration ejbClientConfiguration = new PropertiesBasedEJBClientConfiguration(ejbProperties);

              final ConfigBasedEJBClientContextSelector selector = new ConfigBasedEJBClientContextSelector(

                      ejbClientConfiguration);

              EJBClientContext.setSelector(selector);

              EJBClientContext.getCurrent().registerInterceptor(0, new ClientInterceptor());

       

              final Context ejbContext = new InitialContext(contextProperties);

       

              String lookupString = "ejb:B-ear/B-ejb/AAdapter"

                      + "!com.....AAdapter";

              final AAdapter test = (AAdapter ) ejbContext.lookup(lookupString);

              test.doSomething("someData");

       

       

      This code above works as expected from a standard java application, but not from an EAR! (No properties or config files needed.)

      If we run this code from inside an ear we get (probably as expected) : "EJBCLIENT000021: EJB client context selector may not be changed"

       

      But we can actually get the communication from EAR A to EAR B to work if we for example follow this guide (and other guides):

      EJB invocations from a remote server instance - JBoss AS 7.1 - Project Documentation Editor

       

      The problem is that in all these guides the user (and password) are "hard-coded" in the standalone xml:

       

                <security-realm name="ejb-security-realm">

                      <server-identities>

                          <secret value="dGVzdA=="/>

                      </server-identities>

                  </security-realm>

      ....

                <outbound-connections>

                      <remote-outbound-connection name="remote-ejb-connection" outbound-socket-binding-ref="remote-ejb" security-realm="ejb-security-realm" username="ejb">

                          <properties>

                              <property name="SASL_POLICY_NOANONYMOUS" value="false"/>

                              <property name="SSL_ENABLED" value="false"/>

                          </properties>

                      </remote-outbound-connection>

                  </outbound-connections>

       

      So the question is: How can you configure and code a remote call to use the supplied user and password from the code (not config files) when you are inside an EAR container?

       

      We have tried a bit with "scoped context" but it did not seem to work either.

       

      I have tried to keep this post short, please tell me if you need more information. Any help would be appreciated!

        • 1. Re: Remote EJB call from EAR to EAR using database login module
          jaikiran

          Christian Sandborg wrote:

           


          We have tried a bit with "scoped context" but it did not seem to work either.

           

          I have tried to keep this post short, please tell me if you need more information. Any help would be appreciated!

          I would be interested in seeing the details (code and any exception stacktraces) related to your scoped context experiments. I expect that to work.

          • 2. Re: Remote EJB call from EAR to EAR using database login module
            christian-sandborg

            Thanks, when trying with scoped context I get "Unrecognized SSL message":

             

            10:31:31,290 WARN  [org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector] (http-/0.0.0.0:8280-1) Could not register a EJB receiver for connection to localhost:4447: java.lang.RuntimeException: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?

              at org.jboss.ejb.client.remoting.IoFutureHelper.get(IoFutureHelper.java:92) [jboss-ejb-client-1.0.30.Final-redhat-1.jar:1.0.30.Final-redhat-1]

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

            ..

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

              at sun.security.ssl.EngineInputRecord.bytesInCompletePacket(EngineInputRecord.java:171) [jsse.jar:1.7.0_75]

              at sun.security.ssl.SSLEngineImpl.readNetRecord(SSLEngineImpl.java:851) [jsse.jar:1.7.0_75]


            Here is the code i tried from EAR A:


                      Properties p = new Properties();

                        p.put("remote.connections", "node1");

                        p.put("remote.connection.node1.port", "4447"); // the default remoting port, replace if necessary

                        p.put("remote.connection.node1.host", "localhost"); // the host, replace if necessary

                        p.put("remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED", "false"); // the server defaults to SSL_ENABLED=false

             

             

                        p.put("remote.connection.node1.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS", "true");

                        p.put("remote.connection.node1.connect.options.org.xnio.Options.SASL_DISALLOWED_MECHANISMS",

                                "JBOSS-LOCAL-USER");

                        p.put("remote.connection.node1.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT", "false");

             

                        p.put("remote.connection.node1.username", "someuser");

                        p.put("remote.connection.node1.password", "somepwd");

             

                        p.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");

                        p.put("org.jboss.ejb.client.scoped.context", true); // enable scoping here

             

                        Context context = new InitialContext(p);

                        Context ejbRootNamingContext = (Context) context.lookup("ejb:");

             

                        String lookupString = "B-ear/B-ejb/AAdapter"

                            + "!com.....AAdapter";

             

                        final AAdapter login2 = (AAdapter) ejbRootNamingContext.lookup(lookupString);

             

            What could be the problem? How should the config of remoting-connector etc look in standalone.xml?

            • 3. Re: Remote EJB call from EAR to EAR using database login module
              jaikiran

              Can you please paste the complete exception stacktrace? The one you posted is missing some information that I'm looking for.

              • 4. Re: Remote EJB call from EAR to EAR using database login module
                christian-sandborg

                OK, here it is:

                 

                10:58:45,208 WARN  [org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector] (http-/0.0.0.0:8280-1) Could not register a EJB receiver for connection to localhost:4447: java.lang.RuntimeException: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?

                  at org.jboss.ejb.client.remoting.IoFutureHelper.get(IoFutureHelper.java:92) [jboss-ejb-client-1.0.30.Final-redhat-1.jar:1.0.30.Final-redhat-1]

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

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

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

                  at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.getCurrent(ConfigBasedEJBClientContextSelector.java:115) [jboss-ejb-client-1.0.30.Final-redhat-1.jar:1.0.30.Final-redhat-1]

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

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

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

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

                  at org.jboss.as.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:141)

                  at javax.naming.InitialContext.lookup(InitialContext.java:411) [rt.jar:1.7.0_75]

                  at javax.naming.InitialContext.lookup(InitialContext.java:411) [rt.jar:1.7.0_75]

                  at com....ourcode....api.util.SessionManager.getContext(SessionManager.java:125) [:]

                  at com....ourcode....api.ejb.beans.LoginManagerBean.login(LoginManagerBean.java:31) [:]

                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_75]

                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_75]

                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_75]

                  at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_75]

                  at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52) [jboss-as-ee-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]

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

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

                  at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63) [jboss-as-ee-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]

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

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

                  at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63) [jboss-as-ee-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]

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

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

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

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

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

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

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

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

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

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

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

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

                  at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:280) [jboss-as-ejb3-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]

                  at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:345) [jboss-as-ejb3-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]

                  at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:243) [jboss-as-ejb3-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]

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

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

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

                  at org.jboss.as.ejb3.component.invocationmetrics.WaitTimeInterceptor.processInvocation(WaitTimeInterceptor.java:43) [jboss-as-ejb3-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]

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

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

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

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

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

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

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

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

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

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

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

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

                  at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:185) [jboss-as-ee-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]

                  at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:185) [jboss-as-ee-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]

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

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

                  at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:73) [jboss-as-ee-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]

                  at com....ourcode....api.ejb.LoginManager$$$view2.login(Unknown Source) [:]

                  at com....ourcode....api.services.AuthenticationService.login(AuthenticationService.java:75)

                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_75]

                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_75]

                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_75]

                  at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_75]

                  at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:173)

                  at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:89)

                  at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:61)

                  at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:75)

                  at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)

                  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_75]

                  at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_75]

                  at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)

                  at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)

                  at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)

                  at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:113)

                  at org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:102)

                  at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:464)

                  at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:188)

                  at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:148)

                  at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179)

                  at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:103)

                  at javax.servlet.http.HttpServlet.service(HttpServlet.java:754) [jboss-servlet-api_3.0_spec-1.0.2.Final-redhat-2.jar:1.0.2.Final-redhat-2]

                  at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159)

                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295)

                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)

                  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:231)

                  at org.apache.catalina.core.StandardContextValve.__invoke(StandardContextValve.java:149)

                  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java)

                  at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169)

                  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:150)

                  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97)

                  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102)

                  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344)

                  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:854)

                  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653)

                  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926)

                  at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_75]

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

                  at sun.security.ssl.EngineInputRecord.bytesInCompletePacket(EngineInputRecord.java:171) [jsse.jar:1.7.0_75]

                  at sun.security.ssl.SSLEngineImpl.readNetRecord(SSLEngineImpl.java:851) [jsse.jar:1.7.0_75]

                  at sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:764) [jsse.jar:1.7.0_75]

                  at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:624) [rt.jar:1.7.0_75]

                  at org.xnio.ssl.JsseConnectedSslStreamChannel.unwrap(JsseConnectedSslStreamChannel.java:446) [xnio-api-3.0.13.GA-redhat-1.jar:3.0.13.GA-redhat-1]

                  at org.xnio.ssl.JsseConnectedSslStreamChannel.read(JsseConnectedSslStreamChannel.java:487) [xnio-api-3.0.13.GA-redhat-1.jar:3.0.13.GA-redhat-1]

                  at org.xnio.ssl.JsseConnectedSslStreamChannel.read(JsseConnectedSslStreamChannel.java:452) [xnio-api-3.0.13.GA-redhat-1.jar:3.0.13.GA-redhat-1]

                  at org.xnio.channels.FramedMessageChannel.receive(FramedMessageChannel.java:90) [xnio-api-3.0.13.GA-redhat-1.jar:3.0.13.GA-redhat-1]

                  at org.jboss.remoting3.remote.ClientConnectionOpenListener$Greeting.handleEvent(ClientConnectionOpenListener.java:165) [jboss-remoting-3.3.4.Final.jar:3.3.4.Final]

                  at org.jboss.remoting3.remote.ClientConnectionOpenListener$Greeting.handleEvent(ClientConnectionOpenListener.java:156) [jboss-remoting-3.3.4.Final.jar:3.3.4.Final]

                  at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72) [xnio-api-3.0.13.GA-redhat-1.jar:3.0.13.GA-redhat-1]

                  at org.xnio.channels.TranslatingSuspendableChannel.handleReadable(TranslatingSuspendableChannel.java:189) [xnio-api-3.0.13.GA-redhat-1.jar:3.0.13.GA-redhat-1]

                  at org.xnio.channels.TranslatingSuspendableChannel$1.handleEvent(TranslatingSuspendableChannel.java:103) [xnio-api-3.0.13.GA-redhat-1.jar:3.0.13.GA-redhat-1]

                  at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72) [xnio-api-3.0.13.GA-redhat-1.jar:3.0.13.GA-redhat-1]

                  at org.xnio.channels.TranslatingSuspendableChannel.handleReadable(TranslatingSuspendableChannel.java:189) [xnio-api-3.0.13.GA-redhat-1.jar:3.0.13.GA-redhat-1]

                  at org.xnio.ssl.JsseConnectedSslStreamChannel.handleReadable(JsseConnectedSslStreamChannel.java:183) [xnio-api-3.0.13.GA-redhat-1.jar:3.0.13.GA-redhat-1]

                  at org.xnio.channels.TranslatingSuspendableChannel$1.handleEvent(TranslatingSuspendableChannel.java:103) [xnio-api-3.0.13.GA-redhat-1.jar:3.0.13.GA-redhat-1]

                  at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72) [xnio-api-3.0.13.GA-redhat-1.jar:3.0.13.GA-redhat-1]

                  at org.xnio.nio.NioHandle.run(NioHandle.java:90) [xnio-nio-3.0.13.GA-redhat-1.jar:3.0.13.GA-redhat-1]

                  at org.xnio.nio.WorkerThread.safeRun(WorkerThread.java:219) [xnio-nio-3.0.13.GA-redhat-1.jar:3.0.13.GA-redhat-1]

                  at org.xnio.nio.WorkerThread.run(WorkerThread.java:132) [xnio-nio-3.0.13.GA-redhat-1.jar:3.0.13.GA-redhat-1]

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

                  at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:270) [jboss-remoting-3.3.4.Final.jar:3.3.4.Final]

                  at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:386) [jboss-remoting-3.3.4.Final.jar:3.3.4.Final]

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

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

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

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

                  ... 98 more

                • 5. Re: Remote EJB call from EAR to EAR using database login module
                  jaikiran

                  Can you try adding this one into the properties that's being passed to the InitialContext:

                   

                  p.put("remote.connection.node1.connect.options.org.xnio.Options.SSL_ENABLED", "false");

                  • 6. Re: Remote EJB call from EAR to EAR using database login module
                    christian-sandborg

                    I tried this now but I still get the same error unfortunately.

                    • 7. Re: Remote EJB call from EAR to EAR using database login module
                      christian-sandborg

                      Now I have found the solution. Maybe I missed some information on how to set up this for an ejb.jar file but the solution was to add this line into the META-INF/MANIFEST.MF:

                       

                      Dependencies: org.jboss.xnio

                       

                      (To add the dependency in the jboss-deployment-structure.xml in ear or ejb.jar did not help for this problem).

                       

                      Anyway Jaikiran thanks for your support!

                      • 8. Re: Remote EJB call from EAR to EAR using database login module
                        jaikiran

                        What you did was the correct fix. However, I'm surprised that this manifested in this fashion. I would have expected a more prominent error about the missing dependency. Could you file a JIRA with a simple application that reproduces this, so that someone can take a look?