6 Replies Latest reply on Mar 15, 2017 10:29 AM by jbertram

    Wildfly10 Failed to create netty connection JMS

    ehsanlinux

      I'm have Wildfly AS setup on my Server A and I need Jms connection from Server B (Server B -> Server A)

       

      I'm using the standalone-full.xml config and have edited it following this guide to enable remote connection

      The output I get is:

       

      Got initial Context: javax.naming.InitialContext@6500df86

      2016-08-16 19:19:43 ERROR org.apache.activemq.artemis.core.client     - AMQ214016: Failed to create netty connection

      java.nio.channels.UnresolvedAddressException

        at sun.nio.ch.Net.checkAddress(Net.java:121)

        at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:617)

        at io.netty.channel.socket.nio.NioSocketChannel.doConnect(NioSocketChannel.java:209)

        at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.connect(AbstractNioChannel.java:207)

        at io.netty.channel.DefaultChannelPipeline$HeadContext.connect(DefaultChannelPipeline.java:1097)

        at io.netty.channel.AbstractChannelHandlerContext.invokeConnect(AbstractChannelHandlerContext.java:481)

        at io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChannelHandlerContext.java:466)

        at io.netty.channel.ChannelOutboundHandlerAdapter.connect(ChannelOutboundHandlerAdapter.java:47)

        at io.netty.channel.CombinedChannelDuplexHandler.connect(CombinedChannelDuplexHandler.java:167)

        at io.netty.channel.AbstractChannelHandlerContext.invokeConnect(AbstractChannelHandlerContext.java:481)

        at io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChannelHandlerContext.java:466)

        at io.netty.channel.ChannelDuplexHandler.connect(ChannelDuplexHandler.java:50)

        at io.netty.channel.AbstractChannelHandlerContext.invokeConnect(AbstractChannelHandlerContext.java:481)

        at io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChannelHandlerContext.java:466)

        at io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChannelHandlerContext.java:448)

        at io.netty.channel.DefaultChannelPipeline.connect(DefaultChannelPipeline.java:908)

        at io.netty.channel.AbstractChannel.connect(AbstractChannel.java:203)

        at io.netty.bootstrap.Bootstrap$2.run(Bootstrap.java:166)

        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:358)

        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357)

        at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)

        at java.lang.Thread.run(Thread.java:745)

      Exception in thread "main" javax.jms.JMSException: Failed to create session factory

       

       

      i need connect from server B to server A:

      public final static String WILDFLY_REMOTING_URL="http-remoting://136.240.163.72:8080";// server A jms address

      props.put(Context.INITIAL_CONTEXT_FACTORY,"org.jboss.naming.remote.client.InitialContextFactory");

      props.put(Context.PROVIDER_URL, WILDFLY_REMOTING_URL);  // NOTICE: "http-remoting://136.240.163.72:8080" and port "8080"
      props.put(Context.SECURITY_PRINCIPAL, JMS_USERNAME);

      props.put(Context.SECURITY_CREDENTIALS, JMS_PASSWORD);

       

      my standalone-full:

      <interfaces>

              <interface name="management">

                  <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>

              </interface>

        <interface name="public">

        <inet-address value="${jboss.bind.address:0.0.0.0}"/>

        </interface>

              <interface name="unsecure">

                  <inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/>

              </interface>

          </interfaces>

       

      run :

      standalone.bat -b 0.0.0.0 -bmanagement 0.0.0.0 --server-config=standalone-full.xml  -Djboss.node.name=Receiver

       

      Is my problem caused by setting up remote and can it be solved?

        • 1. Re: Wildfly10 Failed to create netty connection JMS
          jbertram

          This is almost certainly caused your use of 0.0.0.0.  You'll probably see a message in your log like this:

          Invalid "host" value "0.0.0.0" detected for "http-connector" connector. Switching to <some-other-IP>. If this new address is incorrect please manually configure the connector to use the proper one.

          Using 0.0.0.0 for a connector is invalid.  Here how the configuration works:

          • JMS client looks up and uses a particular connection factory, e.g. "jms/RemoteConnectionFactory".
          • Said connection factory is configured to use a particular connector, e.g. "http-connector".
          • The connector is configured with a particular socket-binding, e.g. "http".
          • The socket-binding is configured to use a particular interface, e.g. "public".
          • The interface is configured to use a particular inet-address, e.g. 0.0.0.0 in your case.

           

          The address 0.0.0.0 is invalid for a client so Artemis will switch the connector to a concrete address, but it has no way of knowing if that address is visible to the client.  It issues the aforementioned INFO level message in the log to alert the user to the situation.

           

          BTW, this has been covered on the forums in multiple places.

          • 2. Re: Wildfly10 Failed to create netty connection JMS
            ehsanlinux

            Thanks @Justin Bertram

            i run wildfly  :

            standalone.bat -b 136.240.163.72 -bmanagement 136.240.163.72 --server-config=standalone-full.xml  -Djboss.node.name=Receiver

            and I add outbound-socket-binding in socket-binding in standalone-full :


            <outbound-socket-binding name="http-remote-jms">

              <remote-destination host="136.240.163.72" port="${jboss.http.port:8080}"/>

              </outbound-socket-binding>


            • 3. Re: Wildfly10 Failed to create netty connection JMS
              jbertram

              I'm a bit unclear on what your comment means.

               

              Are you saying that everything is working now?  If not, what specifically isn't working?

               

              Also, why did you add the new outbound-socket-binding?  What purpose does it serve?

              • 4. Re: Wildfly10 Failed to create netty connection JMS
                ehsanlinux

                Yes everything is working now

                • 5. Re: Wildfly10 Failed to create netty connection JMS
                  lauradp

                  Hi,

                  I'm facing the same issue!

                   

                  Can you please share your standalone.xml?

                   

                  Did you include jboss-client.jar into your app?

                  • 6. Re: Wildfly10 Failed to create netty connection JMS
                    jbertram

                    If you review the answer which is marked as correct you should be able to sort out your issue just as the original thread author did (assuming your problem is the same).  If you can't sort it out given the information already on the thread then I recommend you create a new thread and explain your use-case and the problem you're seeing.