2 Replies Latest reply on Sep 7, 2012 3:24 PM by Vatsan Madabushi

    EJB client on a JB7.1.1 server is unable to connect to clustered EJB servers on different JB7.1.1 instance

    Vatsan Madabushi Novice

      I am having an issue when trying to connect an EJB client on 1 JB7.1.1 server with a clustered EJB servers on diff JB7.1.1 instances.  I am using a standalong-ha.xml out of the box (only the port numbers and IP is changed).  My setup descrition is below. The connections are non-SSL based but when I try to conect I get the error below in the client log.  All the code is deployed into both instances.  When the instances are started, they do show that they are clustered in the logs.

       

      Server Instance 1 :

      ----------------------------

      standalone.bat -server-config=standalone-ha.xml -Djboss.server.base.dir=web1 -Djboss.node.name=web1

      ......

      <subsystem xmlns="urn:jboss:domain:remoting:1.1">

                  <connector name="remoting-connector" socket-binding="remoting"/>

      </subsystem>

      ......

      <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">

              <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9998}"/>

              <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9992}"/>

              <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9443}"/>

              <socket-binding name="ajp" port="8009"/>

              <socket-binding name="http" port="8080"/>

              <socket-binding name="https" port="8443"/>

              <socket-binding name="jgroups-diagnostics" port="0" multicast-address="224.0.75.75" multicast-port="7500"/>

              <socket-binding name="jgroups-mping" port="0" multicast-address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="45700"/>

              <socket-binding name="jgroups-tcp" port="7600"/>

              <socket-binding name="jgroups-tcp-fd" port="57600"/>

              <socket-binding name="jgroups-udp" port="55555" multicast-address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="55988"/>

              <socket-binding name="jgroups-udp-fd" port="54200"/>

              <socket-binding name="modcluster" port="0" multicast-address="224.0.1.105" multicast-port="23364"/>

              <socket-binding name="osgi-http" interface="management" port="8090"/>

              <socket-binding name="remoting" port="32010"/>

              <socket-binding name="txn-recovery-environment" port="4712"/>

              <socket-binding name="txn-status-manager" port="4713"/>

              <outbound-socket-binding name="mail-smtp">

                  <remote-destination host="localhost" port="25"/>

              </outbound-socket-binding>

          </socket-binding-group>

       

       

      Server Instance 2 :

      ----------------------------

      standalone.bat -server-config=standalone-ha.xml -Djboss.socket.binding.port-offset=100 -Djboss.node.name=web2 -Djboss.server.base.dir=web2

      ......

      <subsystem xmlns="urn:jboss:domain:remoting:1.1">

                  <connector name="remoting-connector" socket-binding="remoting"/>

      </subsystem>

      ......

      <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:10}">

              <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/>

              <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>

              <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9443}"/>

              <socket-binding name="ajp" port="8009"/>

              <socket-binding name="http" port="8080"/>

              <socket-binding name="https" port="8443"/>

              <socket-binding name="jgroups-diagnostics" port="0" multicast-address="224.0.75.75" multicast-port="7500"/>

              <socket-binding name="jgroups-mping" port="0" multicast-address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="45700"/>

              <socket-binding name="jgroups-tcp" port="7600"/>

              <socket-binding name="jgroups-tcp-fd" port="57600"/>

              <socket-binding name="jgroups-udp" port="55555" multicast-address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="55988"/>

              <socket-binding name="jgroups-udp-fd" port="54200"/>

              <socket-binding name="modcluster" port="0" multicast-address="224.0.1.105" multicast-port="23364"/>

              <socket-binding name="osgi-http" interface="management" port="8090"/>

              <socket-binding name="remoting" port="32010"/>

              <socket-binding name="txn-recovery-environment" port="4712"/>

              <socket-binding name="txn-status-manager" port="4713"/>

              <outbound-socket-binding name="mail-smtp">

                  <remote-destination host="localhost" port="25"/>

              </outbound-socket-binding>

          </socket-binding-group>

       

      Client instance:

      ----------------------------

      uses the standalone-full.xml

      .....

      <subsystem xmlns="urn:jboss:domain:remoting:1.1">

                  <connector name="remoting-connector" socket-binding="remoting"/>

                  <outbound-connections>

                      <remote-outbound-connection name="remote-ejb-connection1" outbound-socket-binding-ref="remote-ejb1">

                          <properties>

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

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

                          </properties>

                      </remote-outbound-connection>

                      <remote-outbound-connection name="remote-ejb-connection2" outbound-socket-binding-ref="remote-ejb2">

                          <properties>

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

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

                          </properties>

                      </remote-outbound-connection>

                      <remote-outbound-connection name="remote-ejb-connection3" outbound-socket-binding-ref="remote-ejb3">

                          <properties>

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

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

                          </properties>

                      </remote-outbound-connection>

                  </outbound-connections>

              </subsystem>

      .....

      <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">

              <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/>

              <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9443}"/>

              <socket-binding name="ajp" port="11442"/>

              <socket-binding name="http" port="8130"/>

              <socket-binding name="https" port="8443"/>

              <socket-binding name="jacorb" interface="unsecure" port="3528"/>

              <socket-binding name="jacorb-ssl" interface="unsecure" port="3529"/>

              <socket-binding name="messaging" port="5445"/>

              <socket-binding name="messaging-throughput" port="5455"/>

              <socket-binding name="osgi-http" interface="management" port="8090"/>

              <socket-binding name="remoting" port="4447"/>

              <socket-binding name="txn-recovery-environment" port="4712"/>

              <socket-binding name="txn-status-manager" port="4713"/>

              <outbound-socket-binding name="mail-smtp">

                  <remote-destination host="localhost" port="25"/>

              </outbound-socket-binding>

              <outbound-socket-binding name="remote-ejb1">

                  <remote-destination host="wfmuat.odc.vzwcorp.com" port="32010"/>

              </outbound-socket-binding>

              <outbound-socket-binding name="remote-ejb2">

                  <remote-destination host="wfmuat.odc.vzwcorp.com" port="32020"/>

              </outbound-socket-binding>

              <outbound-socket-binding name="remote-ejb3">  <!-- unsed for now -->

                  <remote-destination host="wfmuat.odc.vzwcorp.com" port="32030"/>

              </outbound-socket-binding>

          </socket-binding-group>

       

      Error statck trace:

      ----------------------------

       

      16:13:42,808 ERROR [org.jboss.remoting.remote.connection] (Remoting "wfmweb" read-1) JBREM000200: Remote connection failed: javax.security.sasl.Sasl
      Exception: Authentication failed: all available authentication mechanisms failed
      16:13:42,841 INFO  [org.jboss.ejb.client.remoting.VersionReceiver] (Remoting "wfmweb" task-1) Received server version 1 and marshalling strategies [
      river]
      16:13:42,852 INFO  [org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver] (MSC service thread 1-6) Successful version handshake completed for
      receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext@4de8d8, receiver=Remoting connection EJB receiver [connecti
      on=Remoting connection <163f47e>,channel=jboss.ejb,nodename=wfm-ejb-web1]} on channel Channel ID e15c557d (outbound) of Remoting connection 00047934
      to wfmuat.odc.vzwcorp.com/10.170.49.190:32010
      16:13:42,972 ERROR [org.jboss.remoting.remote.connection] (Remoting "wfmweb" read-1) JBREM000200: Remote connection failed: javax.net.ssl.SSLExcepti
      on: Unrecognized SSL message, plaintext connection?
      16:13:42,975 ERROR [org.jboss.remoting.remote.connection] (Remoting "wfmweb" read-1) JBREM000200: Remote connection failed: javax.net.ssl.SSLExcepti
      on: Unrecognized SSL message, plaintext connection?
      16:13:42,977 INFO  [org.jboss.ejb.client.remoting.RemotingConnectionClusterNodeManager] (ejb-client-cluster-node-connection-creation-4-thread-2) Cou
      ld not create a connection for cluster node ClusterNode{clusterName='ejb', nodeName='wfm-ejb-web1', clientMappings=[ClientMapping{sourceNetworkAddre
      ss=/0:0:0:0:0:0:0:0, sourceNetworkMaskBits=0, destinationAddress='xx.xxx.xx.xxx', destinationPort=32010}], resolvedDestination=[Destination address=
      10.170.49.190, destination port=32010]} in cluster ejb: java.lang.RuntimeException: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext
      connection?
              at org.jboss.ejb.client.remoting.IoFutureHelper.get(IoFutureHelper.java:91)
              at org.jboss.ejb.client.remoting.RemotingConnectionClusterNodeManager.getEJBReceiver(RemotingConnectionClusterNodeManager.java:91)
              at org.jboss.ejb.client.ClusterContext$EJBReceiverAssociationTask.run(ClusterContext.java:333)
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [rt.jar:1.6.0.13]
              at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) [rt.jar:1.6.0.13]
              at java.util.concurrent.FutureTask.run(FutureTask.java:138) [rt.jar:1.6.0.13]
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0.13]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0.13]
              at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0.13]
      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) [xnio-api-3.0.3.GA.jar:3.0.3.GA]
              at org.xnio.ssl.JsseConnectedSslStreamChannel.read(JsseConnectedSslStreamChannel.java:484) [xnio-api-3.0.3.GA.jar:3.0.3.GA]
              at org.xnio.ssl.JsseConnectedSslStreamChannel.read(JsseConnectedSslStreamChannel.java:449) [xnio-api-3.0.3.GA.jar:3.0.3.GA]
              at org.xnio.channels.FramedMessageChannel.receive(FramedMessageChannel.java:88) [xnio-api-3.0.3.GA.jar:3.0.3.GA]
              at org.jboss.remoting3.remote.ClientConnectionOpenListener$Greeting.handleEvent(ClientConnectionOpenListener.java:138) [jboss-remoting-3.2.3
      .GA.jar:3.2.3.GA]
              at org.jboss.remoting3.remote.ClientConnectionOpenListener$Greeting.handleEvent(ClientConnectionOpenListener.java:130) [jboss-remoting-3.2.3
      .GA.jar:3.2.3.GA]
              at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72) [xnio-api-3.0.3.GA.jar:3.0.3.GA]
              at org.xnio.channels.TranslatingSuspendableChannel.handleReadable(TranslatingSuspendableChannel.java:189) [xnio-api-3.0.3.GA.jar:3.0.3.GA]
              at org.xnio.channels.TranslatingSuspendableChannel$1.handleEvent(TranslatingSuspendableChannel.java:103) [xnio-api-3.0.3.GA.jar:3.0.3.GA]
              at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72) [xnio-api-3.0.3.GA.jar:3.0.3.GA]
              at org.xnio.channels.TranslatingSuspendableChannel.handleReadable(TranslatingSuspendableChannel.java:189) [xnio-api-3.0.3.GA.jar:3.0.3.GA]
              at org.xnio.ssl.JsseConnectedSslStreamChannel.handleReadable(JsseConnectedSslStreamChannel.java:180) [xnio-api-3.0.3.GA.jar:3.0.3.GA]
              at org.xnio.channels.TranslatingSuspendableChannel$1.handleEvent(TranslatingSuspendableChannel.java:103) [xnio-api-3.0.3.GA.jar:3.0.3.GA]
              at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72) [xnio-api-3.0.3.GA.jar:3.0.3.GA]
              at org.xnio.nio.NioHandle.run(NioHandle.java:90)
              at org.xnio.nio.WorkerThread.safeRun(WorkerThread.java:205)
              at org.xnio.nio.WorkerThread.run(WorkerThread.java:121)
              at ...asynchronous invocation...(Unknown Source)
              at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:270) [jboss-remoting-3.2.3.GA.jar:3.2.3.GA]
              at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:251) [jboss-remoting-3.2.3.GA.jar:3.2.3.GA]
              at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:349) [jboss-remoting-3.2.3.GA.jar:3.2.3.GA]
              at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:333) [jboss-remoting-3.2.3.GA.jar:3.2.3.GA]
              at org.jboss.ejb.client.remoting.RemotingConnectionClusterNodeManager.getEJBReceiver(RemotingConnectionClusterNodeManager.java:89)
              ... 7 more

      16:13:42,977 INFO  [org.jboss.ejb.client.remoting.RemotingConnectionClusterNodeManager] (ejb-client-cluster-node-connection-creation-4-thread-1) Cou
      ld not create a connection for cluster node ClusterNode{clusterName='ejb', nodeName='wfm-ejb-web2', clientMappings=[ClientMapping{sourceNetworkAddre
      ss=/0:0:0:0:0:0:0:0, sourceNetworkMaskBits=0, destinationAddress='xx.xxx.xx.xxx', destinationPort=32020}], resolvedDestination=[Destination address=
      10.170.49.190, destination port=32020]} in cluster ejb: java.lang.RuntimeException: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext
      connection?

      ......

        • 1. Re: EJB client on a JB7.1.1 server is unable to connect to clustered EJB servers on different JB7.1.1 instance
          Wolf-Dieter Fink Master

          You might not change the "${jboss.socket.binding.port-offset:10}" as you change it by the option -Djboss.socket.binding.port-offset=100

          Also I would recommend to not change single ports, the offset of 100/200/... should work.

           

          The outbound ports should be than 4447,4547, 4647

           

          Could you post your client code?


          • 2. Re: EJB client on a JB7.1.1 server is unable to connect to clustered EJB servers on different JB7.1.1 instance
            Vatsan Madabushi Novice

            Sorry, couldnt format code properly.

             

             

             

             

             

             

             

            USE_JB7=true;

            try

            {

                 ic = createInitialContext(providerUrl);

             

                 final String appName = "wfm";

             

                 final String moduleName = "wfm";

            //JB7 specific

             

                 final String distinctName = "";

            //JB7 specific

             

             

                 // The EJB name which by default is the simple class name of the bean implementation class

             

            //final String beanName = EJBClient.class.getSimpleName(); //JB7 specific

             

                 final String beanName = "ETMImpl";

            //JB7 specific

                 final String viewClassName = wfm.server.etm.ETMInterface.class.getName();

             

                 er.Logit("lookup", "Initial context created:::>"+ ic);

             

                 er.Logit("lookup", "JNDI created:::> ejb:" + appName + "/" + moduleName + "/" + distinctName + "/"+ beanName + "!"
            + viewClassName);

                 String jndiName =

             

            "ejb:" + appName + "/" + moduleName + "/" + distinctName + "/" + beanName + "!"

            + viewClassName;

             

            er.Logit("lookup", "JNDI2 created:::> " + jndiName);

             

            if(USE_JB7 != true )

            {

             

                 er.Logit("lookup", "EJBClient Using JB4" );

             

                 return ic.lookup(name);

                 //JB4.2.2

            }

             

            else

            {

             

            //return(ic.lookup("ejb:" + appName + "/" + moduleName + "/" + distinctName + "/" + beanName + "!"

             

            //+ viewClassName)); //JB7 specific

             

                 er.Logit("lookup", "Using JB7");

                 er.Logit("lookup", "EJBClient Using JB7 - JNDI Name-"+ jndiName);

             

                 if(ic.lookup(jndiName));

            }

            }

            }

             

             

            finally

            {

             

                 if (ic != null )

            {

                 ic.close();

            }

            }