1 2 Previous Next 16 Replies Latest reply on Oct 23, 2014 8:54 AM by jiji1james

    Unable to connect create netty connection (HornetQ 2.3.1 Final + JBoss EAP 6.1)

    vahid001

      Hello all,

       

      I have been struggling with this issue for days and have read various posts and documentation regarding Netty and HornetQ to have this resolved, so this is kind of a last resort (hoping someone can help get this clarified).

       

      Please see below for the key information segments in bold

       

      When connecting remotely to a JMS queue, I keep getting the following error on the client side:

       

      Nov 8, 2013 7:46:44 PM org.xnio.Xnio <clinit>

      INFO: XNIO Version 3.0.7.GA-redhat-1

      Nov 8, 2013 7:46:44 PM org.xnio.nio.NioXnio <clinit>

      INFO: XNIO NIO Implementation Version 3.0.7.GA-redhat-1

      Nov 8, 2013 7:46:44 PM org.jboss.remoting3.EndpointImpl <clinit>

      INFO: JBoss Remoting version 3.2.16.GA-redhat-1

      Nov 8, 2013 7:46:58 PM org.hornetq.core.remoting.impl.netty.NettyConnector createConnection

      ERROR: HQ214016: Failed to create netty connection

      java.net.SocketTimeoutException: connect timed out

        at java.net.PlainSocketImpl.socketConnect(Native Method)

        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:382)

        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:241)

        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:228)

        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:431)

        at java.net.Socket.connect(Socket.java:527)

        at org.jboss.netty.channel.socket.oio.OioClientSocketPipelineSink.connect(OioClientSocketPipelineSink.java:105)

        at org.jboss.netty.channel.socket.oio.OioClientSocketPipelineSink.eventSunk(OioClientSocketPipelineSink.java:65)

        at org.jboss.netty.channel.Channels.connect(Channels.java:634)

        at org.jboss.netty.channel.AbstractChannel.connect(AbstractChannel.java:207)

        at org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:229)

        at org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:182)

        at org.hornetq.core.remoting.impl.netty.NettyConnector.createConnection(NettyConnector.java:628)

        at org.hornetq.core.client.impl.ClientSessionFactoryImpl.getConnection(ClientSessionFactoryImpl.java:1223)

        at org.hornetq.core.client.impl.ClientSessionFactoryImpl.getConnectionWithRetry(ClientSessionFactoryImpl.java:1069)

        at org.hornetq.core.client.impl.ClientSessionFactoryImpl.connect(ClientSessionFactoryImpl.java:246)

        at org.hornetq.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:828)

        at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:583)

        at org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:107)

        at org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:102)

        at com.helios.model.TestJMS.main(TestJMS.java:130)

      Nov 8, 2013 7:46:58 PM org.jboss.naming.remote.protocol.v1.RemoteNamingStoreV1$MessageReceiver handleEnd

      ERROR: Channel end notification received, closing channel Channel ID bf946580 (outbound) of Remoting connection 372c9557 to /remoteipHere:4447

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

        at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:587)

        at org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:107)

        at org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:102)

        at com.helios.model.TestJMS.main(TestJMS.java:130)

      Caused by: HornetQException[errorType=NOT_CONNECTED message=HQ119007: Cannot connect to server(s). Tried with all available servers.]

        at org.hornetq.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:852)

        at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:583)

        ... 3 more

       

      Hereby the output on JBoss server side:

      [org.jboss.as.naming] (Remoting "hosted-by" task-4) JBAS011806: Channel end notification received, closing channel Channel ID 3f946580 (inbound) of Remoting connection 1555511f to null

       

      I have a standalone.xml configured with the following information (these are the relevant snippets):

       

      <subsystem xmlns="urn:jboss:domain:messaging:1.3">

                  <hornetq-server>

                      <persistence-enabled>true</persistence-enabled>

                      <security-enabled>false</security-enabled>

                      <journal-type>NIO</journal-type>

                      <journal-min-files>2</journal-min-files>

       

                      <connectors>

                          <netty-connector name="netty" socket-binding="messaging">

                          </netty-connector>

                          <netty-connector name="netty-throughput" socket-binding="messaging-throughput">

                              <param key="batch-delay" value="50"/>

                          </netty-connector>

                          <in-vm-connector name="in-vm" server-id="0"/>

                      </connectors>

       

                      <acceptors>

                          <netty-acceptor name="netty" socket-binding="messaging">

                          </netty-acceptor>

                          <netty-acceptor name="netty-throughput" socket-binding="messaging-throughput">

                              <param key="batch-delay" value="50"/>

                              <param key="direct-deliver" value="false"/>

                          </netty-acceptor>

                          <in-vm-acceptor name="in-vm" server-id="0"/>

                      </acceptors>

      ......

      ......

      <jms-connection-factories>

                          <connection-factory name="InVmConnectionFactory">

                              <connectors>

                                  <connector-ref connector-name="in-vm"/>

                              </connectors>

                              <entries>

                                  <entry name="java:/ConnectionFactory"/>

                              </entries>

                          </connection-factory>

                          <connection-factory name="RemoteConnectionFactory">

                              <connectors>

                                  <connector-ref connector-name="netty"/>

                              </connectors>

                              <entries>

                                  <entry name="java:jboss/exported/jms/RemoteConnectionFactory"/>

                              </entries>

                              <client-failure-check-period>60000</client-failure-check-period>

                              <connection-ttl>150000</connection-ttl>

                              <call-timeout>30000</call-timeout>

                                  <consumer-window-size>1048576</consumer-window-size>

                </connection-factory>  

                <jms-destinations>   

                          <jms-queue name="testersQueue">

                              <entry name="queue/Testers"/>

                              <entry name="java:jboss/exported/jms/queue/Testers"/>

                          </jms-queue>

                      </jms-destinations>

      .......

      .......

          <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:127.0.0.1}"/>

              </interface>

              <interface name="any">

                  <any-address/>

              </interface>

              <interface name="unsecure">

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

              </interface>

          </interfaces>

       

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

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

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

              <socket-binding name="management-https" interface="any" 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="remoting" port="4447"/>

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

              <socket-binding name="messaging-group" port="0" multicast-address="${jboss.messaging.group.address:231.7.7.7}" multicast-port="${jboss.messaging.group.port:9876}"/>

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

              <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>

       

       

      When starting JBoss the following message is shown:


      HQ221020: Started Netty Acceptor version 3.6.2.Final-redhat-1-c0d783c 0.0.0.0:5455 for CORE protocol

      HQ221020: Started Netty Acceptor version 3.6.2.Final-redhat-1-c0d783c 0.0.0.0:5445 for CORE protocol

      HQ121005: Invalid "host" value "0.0.0.0" detected for "netty" connector. Switching to "hosted-by.webxtra.net". If this new address is incorrect please manually configure the connector to use the proper one.

       

      Also tried adding the "param host and port" as stated in the example below for both connector and acceptor, but still no luck:

      <connectors>

            <connector name="netty">

               <param key="host"  value="${hornetq.remoting.netty.host:0.0.0.0}"/>

               <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>

               <param key="ssl-enabled" value="true"/>

            </connector>

         </connectors>

       

      Some relevant client code is show below:

      Context initialContext = null;

        Properties properties = new Properties();

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

        properties.put(Context.PROVIDER_URL, "remote://remoteIPHere:4447");

        properties.put(Context.SECURITY_AUTHENTICATION, "simple");

        properties.put(Context.SECURITY_PRINCIPAL, "heritrix");

        properties.put(Context.SECURITY_CREDENTIALS, "heritrix#001");

       

        connectionFactory = (ConnectionFactory) context.lookup("jms/RemoteConnectionFactory");

        Queue queue = (Queue) context.lookup("jms/queue/Tester");

       

       

       

       

      I really do hope that someone is able to help figure this out as I have been struggling with this issue now for days.

      Your help is much appreciated.

       

      In case of any more clarification or code/configuration snippets, please let me know. Thanks in advance.

        • 1. Re: Unable to connect create netty connection (HornetQ 2.3.1 Final + JBoss EAP 6.1)
          jbertram

          The IP address "0.0.0.0" is invalid for a connector which is why you see this message:

           

            HQ121005: Invalid "host" value "0.0.0.0" detected for "netty" connector. Switching to "hosted-by.webxtra.net". If this new address is incorrect please manually configure the connector to use the proper one.

           

          My questions are:

          1. Why are you binding the application server to 0.0.0.0?  Can you bind it to a specific interface?  If so, does that resolve the problem?
          2. Is "hosted-by.webxtra.net" available to the remote client which is trying to connect?
          1 of 1 people found this helpful
          • 2. Re: Unable to connect create netty connection (HornetQ 2.3.1 Final + JBoss EAP 6.1)
            vahid001

            Thanks Justin. Your answer and questions pushed me in the right direction.

             

            I binded the IP of the machine on which JBoss was deployed within the standalone.xml config and that really did the trick. Thanks!

            • 3. Re: Unable to connect create netty connection (HornetQ 2.3.1 Final + JBoss EAP 6.1)
              jason.marley

              I had a similar issue and even though I was starting my server and binding to my ip of my machine I was still hitting this problem. Then I realized I had changed my interfaces for both "public" and "management" to bind to "0.0.0.0", when I updated those everything worked as expected.

              • 4. Re: Unable to connect create netty connection (HornetQ 2.3.1 Final + JBoss EAP 6.1)
                sarfaraz-alam.md

                Hi Justin,

                I am getting exactly the same issue. Although i bind netty connector to my ip of machine i was still hitting the same problem. even for interfaces "public" and "management" i bind to ip of my machine.

                 

                HQ121005: Invalid "host" value "0.0.0.0" detected for "netty" connector. Switching to "MDSA1". If this new address is incorrect please manually configure the connector to use the proper one.

                 

                ERROR: HQ214016: Failed to create netty connection

                java.net.SocketTimeoutException: connect timed out

                  at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)

                  at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)

                  at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)

                  at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)

                  at java.net.AbstractPlainSocketImpl.connect(Unknown Source)

                  at java.net.PlainSocketImpl.connect(Unknown Source)

                  at java.net.SocksSocketImpl.connect(Unknown Source)

                  at java.net.Socket.connect(Unknown Source)

                  at org.jboss.netty.channel.socket.oio.OioClientSocketPipelineSink.connect(OioClientSocketPipelineSink.java:109)

                  at org.jboss.netty.channel.socket.oio.OioClientSocketPipelineSink.eventSunk(OioClientSocketPipelineSink.java:69)

                  at org.jboss.netty.channel.Channels.connect(Channels.java:634)

                  at org.jboss.netty.channel.AbstractChannel.connect(AbstractChannel.java:207)

                  at org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:229)

                  at org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:182)

                  at org.hornetq.core.remoting.impl.netty.NettyConnector.createConnection(NettyConnector.java:624)

                  at org.hornetq.core.client.impl.ClientSessionFactoryImpl.getConnection(ClientSessionFactoryImpl.java:1223)

                  at org.hornetq.core.client.impl.ClientSessionFactoryImpl.getConnectionWithRetry(ClientSessionFactoryImpl.java:1069)

                  at org.hornetq.core.client.impl.ClientSessionFactoryImpl.connect(ClientSessionFactoryImpl.java:246)

                  at org.hornetq.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:885)

                  at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:583)

                  at org.hornetq.jms.client.HornetQConnectionFactory.createQueueConnection(HornetQConnectionFactory.java:119)

                  at com.hp.demo.StandaloneQueueSend.init(StandaloneQueueSend.java:56)

                  at com.hp.demo.StandaloneQueueSend.main(StandaloneQueueSend.java:25)

                 

                My program is as follows:

                 

                public class StandaloneQueueSend

                {

                public final static String JNDI_FACTORY="org.jboss.naming.remote.client.InitialContextFactory";

                 

                 

                public static void main(String[] args) throws Exception

                  {

                     if (args.length != 1) {

                         System.out.println("Usage: java StandaloneQueueSend URL");

                         System.out.println("Example:  java StandaloneQueueSend remote://localhost:4447");

                         return;

                     }

                 

                 

                     InitialContext ic = getInitialContext(args[0]);

                     StandaloneQueueSend demo = new StandaloneQueueSend();

                 

                 

                     System.out.println("\n\n\t *** Following shows Looking up a Primitive Datatype located in the JNDI ***");

                     demo.init(ic,"TestQueueOne");

                  }

                 

                 

                private static InitialContext getInitialContext(String url) throws NamingException

                     {

                        Hashtable env = new Hashtable();

                        env.put(Context.INITIAL_CONTEXT_FACTORY, JNDI_FACTORY);

                        env.put(Context.PROVIDER_URL, url);

                 

                 

                        //*************** UserName & Password for the Initial Context for JNDI lookup *************************

                        // ** Make sure that you create a user using "$JBOSS_HOME/bin/add-user.sh" with

                        // **  following userName & Password and the Rolename="guest"

                 

                 

                        env.put(Context.SECURITY_PRINCIPAL, "cteuser");

                        env.put(Context.SECURITY_CREDENTIALS, "password4hp@123");

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

                        InitialContext ic=new InitialContext(env);

                        System.out.println("\n\n\t Got InitialContext ic: "+ic);

                        return ic;

                     }

                 

                 

                  private QueueConnectionFactory qconFactory;

                  private QueueConnection qcon;

                  private QueueSession qsession;

                  private QueueSender qsender;

                  private Queue queue;

                  private TextMessage msg;

                 

                 

                  public void init(Context ctx, String queueName)throws NamingException, JMSException

                  {

                  qconFactory = (QueueConnectionFactory) ctx.lookup("/jms/RemoteConnectionFactory");

                  qcon = qconFactory.createQueueConnection("cteuser","password4hp@123");

                  qsession = qcon.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

                  queue = (Queue) ctx.lookup(queueName);

                  qsender = qsession.createSender(queue);

                  msg = qsession.createTextMessage();

                  qcon.start();

                 

                 

                                for(int i=1;i<=5;i++)

                                  {

                                    String message="Hello Message - "+i+" at "+ new java.util.Date();

                                    msg.setText(message);

                                    System.out.println("\n\t Message Sent : "+message);

                                    qsender.send(msg);

                                  }

                               qcon.close();

                  }

                 

                 

                  }

                 

                Can you please help? am i missing some thing??

                • 5. Re: Unable to connect create netty connection (HornetQ 2.3.1 Final + JBoss EAP 6.1)
                  jbertram

                  I am getting exactly the same issue. Although i bind netty connector to my ip of machine i was still hitting the same problem. even for interfaces "public" and "management" i bind to ip of my machine.

                  Can you paste or attach your configuration?  Also, how are you starting the server (i.e. what command line arguments are you using)?

                   

                  HQ121005: Invalid "host" value "0.0.0.0" detected for "netty" connector. Switching to "MDSA1". If this new address is incorrect please manually configure the connector to use the proper one.

                  If you're seeing this message then it's almost certain there's something wrong with your configuration.

                  • 6. Re: Unable to connect create netty connection (HornetQ 2.3.1 Final + JBoss EAP 6.1)
                    sarfaraz-alam.md

                    Hello Justin,

                    I am using standalone.xml file, please find the file content below:

                     

                    <?xml version='1.0' encoding='UTF-8'?>

                     

                     

                    <server xmlns="urn:jboss:domain:1.5">

                     

                     

                        <extensions>

                            <extension module="org.jboss.as.clustering.infinispan"/>

                            <extension module="org.jboss.as.connector"/>

                            <extension module="org.jboss.as.deployment-scanner"/>

                            <extension module="org.jboss.as.ee"/>

                            <extension module="org.jboss.as.ejb3"/>

                            <extension module="org.jboss.as.jaxrs"/>

                            <extension module="org.jboss.as.jdr"/>

                            <extension module="org.jboss.as.jmx"/>

                            <extension module="org.jboss.as.jpa"/>

                            <extension module="org.jboss.as.jsf"/>

                            <extension module="org.jboss.as.logging"/>

                            <extension module="org.jboss.as.mail"/>

                            <extension module="org.jboss.as.naming"/>

                            <extension module="org.jboss.as.pojo"/>

                            <extension module="org.jboss.as.remoting"/>

                            <extension module="org.jboss.as.sar"/>

                            <extension module="org.jboss.as.security"/>

                            <extension module="org.jboss.as.threads"/>

                            <extension module="org.jboss.as.transactions"/>

                            <extension module="org.jboss.as.web"/>

                            <extension module="org.jboss.as.webservices"/>

                            <extension module="org.jboss.as.weld"/>

                            <extension module="org.jboss.as.messaging"/>

                        </extensions>

                     

                     

                     

                     

                        <management>

                            <security-realms>

                                <security-realm name="ManagementRealm">

                                    <authentication>

                                        <local default-user="$local"/>

                                        <properties path="mgmt-users.properties" relative-to="jboss.server.config.dir"/>

                                    </authentication>

                                    <authorization map-groups-to-roles="false">

                                        <properties path="mgmt-groups.properties" relative-to="jboss.server.config.dir"/>

                                    </authorization>

                                </security-realm>

                                <security-realm name="ApplicationRealm">

                                    <authentication>

                                        <local default-user="$local" allowed-users="*"/>

                                        <properties path="application-users.properties" relative-to="jboss.server.config.dir"/>

                                    </authentication>

                                    <authorization>

                                        <properties path="application-roles.properties" relative-to="jboss.server.config.dir"/>

                                    </authorization>

                                </security-realm>

                            </security-realms>

                            <audit-log>

                                <formatters>

                                    <json-formatter name="json-formatter"/>

                                </formatters>

                                <handlers>

                                    <file-handler name="file" formatter="json-formatter" path="audit-log.log" relative-to="jboss.server.data.dir"/>

                                </handlers>

                                <logger log-boot="true" log-read-only="false" enabled="false">

                                    <handlers>

                                        <handler name="file"/>

                                    </handlers>

                                </logger>

                            </audit-log>

                            <management-interfaces>

                                <native-interface security-realm="ManagementRealm">

                                    <socket-binding native="management-native"/>

                                </native-interface>

                                <http-interface security-realm="ManagementRealm">

                                    <socket-binding http="management-http"/>

                                </http-interface>

                            </management-interfaces>

                            <access-control provider="simple">

                                <role-mapping>

                                    <role name="SuperUser">

                                        <include>

                                            <user name="$local"/>

                                        </include>

                                    </role>

                                </role-mapping>

                            </access-control>

                        </management>

                     

                     

                        <profile>

                            <subsystem xmlns="urn:jboss:domain:logging:1.3">

                                <console-handler name="CONSOLE">

                                    <level name="INFO"/>

                                    <formatter>

                                        <pattern-formatter pattern="%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>

                                    </formatter>

                                </console-handler>

                                <periodic-rotating-file-handler name="FILE" autoflush="true">

                                    <formatter>

                                        <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>

                                    </formatter>

                                    <file relative-to="jboss.server.log.dir" path="server.log"/>

                                    <suffix value=".yyyy-MM-dd"/>

                                    <append value="true"/>

                                </periodic-rotating-file-handler>

                                <logger category="com.arjuna">

                                    <level name="WARN"/>

                                </logger>

                                <logger category="org.apache.tomcat.util.modeler">

                                    <level name="WARN"/>

                                </logger>

                                <logger category="org.jboss.as.config">

                                    <level name="DEBUG"/>

                                </logger>

                                <logger category="sun.rmi">

                                    <level name="WARN"/>

                                </logger>

                                <logger category="jacorb">

                                    <level name="WARN"/>

                                </logger>

                                <logger category="jacorb.config">

                                    <level name="ERROR"/>

                                </logger>

                                <root-logger>

                                    <level name="INFO"/>

                                    <handlers>

                                        <handler name="CONSOLE"/>

                                        <handler name="FILE"/>

                                    </handlers>

                                </root-logger>

                            </subsystem>

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

                                <datasources>

                                    <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">

                                        <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>

                                        <driver>h2</driver>

                                        <security>

                                            <user-name>sa</user-name>

                                            <password>sa</password>

                                        </security>

                                    </datasource>

                                    <datasource jta="true" jndi-name="java:jboss/centralTaxEngine" pool-name="cteDataSource" enabled="true" use-ccm="true">

                                        <connection-url>jdbc:oracle:thin:@g2u1324.austin.hp.com:1525:TAXID</connection-url>

                                        <driver-class>oracle.jdbc.OracleDriver</driver-class>

                                        <driver>OracleJDBCDriver</driver>

                                        <pool>

                                            <min-pool-size>1</min-pool-size>

                                            <max-pool-size>15</max-pool-size>

                                            <use-strict-min>true</use-strict-min>

                                            <flush-strategy>FailingConnectionOnly</flush-strategy>

                                        </pool>

                                        <security>

                                            <user-name>cte_user</user-name>

                                            <password>pw4today_06122012</password>

                                        </security>

                                        <validation>

                                            <validate-on-match>false</validate-on-match>

                                            <background-validation>false</background-validation>

                                        </validation>

                                        <timeout>

                                            <idle-timeout-minutes>10</idle-timeout-minutes>

                                        </timeout>

                                        <statement>

                                            <track-statements>true</track-statements>

                                            <prepared-statement-cache-size>10</prepared-statement-cache-size>

                                            <share-prepared-statements>false</share-prepared-statements>

                                        </statement>

                                    </datasource>

                                    <drivers>

                                        <driver name="h2" module="com.h2database.h2">

                                            <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>

                                        </driver>

                                        <driver name="OracleJDBCDriver" module="oracle.jdbc">

                                            <driver-class>oracle.jdbc.OracleDriver</driver-class>

                                        </driver>

                                    </drivers>

                                </datasources>

                            </subsystem>

                            <subsystem xmlns="urn:jboss:domain:messaging:1.4">

                                <hornetq-server>

                                    <persistence-enabled>true</persistence-enabled>

                                    <journal-type>NIO</journal-type>

                                    <journal-min-files>2</journal-min-files>

                     

                     

                                    <connectors>

                                        <netty-connector name="netty" socket-binding="messaging">

                                            <param key="port" value="${hornetq.remoting.netty.port:5445}"/>

                                            <param key="host" value="${hornetq.remoting.netty.host:127.0.0.1}"/>

                                        </netty-connector>

                                        <netty-connector name="netty-throughput" socket-binding="messaging-throughput">

                                            <param key="batch-delay" value="50"/>

                                            <param key="port" value="${hornetq.remoting.netty.port:5445}"/>

                                            <param key="host" value="${hornetq.remoting.netty.host:127.0.0.1}"/>

                                        </netty-connector>

                                        <in-vm-connector name="in-vm" server-id="0"/>

                                    </connectors>

                     

                     

                                    <acceptors>

                                        <netty-acceptor name="netty" socket-binding="messaging"/>

                                        <netty-acceptor name="netty-throughput" socket-binding="messaging-throughput">

                                            <param key="batch-delay" value="50"/>

                                            <param key="direct-deliver" value="false"/>

                                        </netty-acceptor>

                                        <in-vm-acceptor name="in-vm" server-id="0"/>

                                    </acceptors>

                     

                     

                                    <security-settings>

                                        <security-setting match="#">

                                            <permission type="send" roles="guest"/>

                                            <permission type="consume" roles="guest"/>

                                            <permission type="createNonDurableQueue" roles="guest"/>

                                            <permission type="deleteNonDurableQueue" roles="guest"/>

                                        </security-setting>

                                    </security-settings>

                     

                     

                                    <address-settings>

                                        <address-setting match="#">

                                            <dead-letter-address>jms.queue.DLQ</dead-letter-address>

                                            <expiry-address>jms.queue.ExpiryQueue</expiry-address>

                                            <redelivery-delay>0</redelivery-delay>

                                            <max-size-bytes>10485760</max-size-bytes>

                                            <page-size-bytes>2097152</page-size-bytes>

                                            <address-full-policy>PAGE</address-full-policy>

                                            <message-counter-history-day-limit>10</message-counter-history-day-limit>

                                        </address-setting>

                                    </address-settings>

                     

                     

                                    <jms-connection-factories>

                                        <connection-factory name="InVmConnectionFactory">

                                            <connectors>

                                                <connector-ref connector-name="in-vm"/>

                                            </connectors>

                                            <entries>

                                                <entry name="java:/ConnectionFactory"/>

                                            </entries>

                                        </connection-factory>

                                        <connection-factory name="RemoteConnectionFactory">

                                            <connectors>

                                                <connector-ref connector-name="netty"/>

                                            </connectors>

                                            <entries>

                                                <entry name="java:jboss/exported/jms/RemoteConnectionFactory"/>

                                            </entries>

                                        </connection-factory>

                                        <pooled-connection-factory name="hornetq-ra">

                                            <transaction mode="xa"/>

                                            <connectors>

                                                <connector-ref connector-name="in-vm"/>

                                            </connectors>

                                            <entries>

                                                <entry name="java:/JmsXA"/>

                                            </entries>

                                        </pooled-connection-factory>

                                    </jms-connection-factories>

                     

                     

                                    <jms-destinations>

                                        <jms-queue name="QueueOne">

                                            <entry name="java:jboss/exported/TestQueueOne"/>

                                            <durable>true</durable>

                                        </jms-queue>

                                        <jms-topic name="TopicOne">

                                            <entry name="java:jboss/exported/TestTopicOne"/>

                                        </jms-topic>

                                    </jms-destinations>

                                </hornetq-server>

                            </subsystem>

                            <subsystem xmlns="urn:jboss:domain:deployment-scanner:1.1">

                                <deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000"/>

                            </subsystem>

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

                                <spec-descriptor-property-replacement>false</spec-descriptor-property-replacement>

                                <jboss-descriptor-property-replacement>true</jboss-descriptor-property-replacement>

                            </subsystem>

                            <subsystem xmlns="urn:jboss:domain:ejb3:1.4">

                                <session-bean>

                                    <stateless>

                                        <bean-instance-pool-ref pool-name="slsb-strict-max-pool"/>

                                    </stateless>

                                    <stateful default-access-timeout="5000" cache-ref="simple"/>

                                    <singleton default-access-timeout="5000"/>

                                </session-bean>

                                <mdb>

                                    <resource-adapter-ref resource-adapter-name="${ejb.resource-adapter-name:hornetq-ra}"/>

                                    <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>

                                </mdb>

                                <pools>

                                    <bean-instance-pools>

                                        <strict-max-pool name="slsb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>

                                        <strict-max-pool name="mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>

                                    </bean-instance-pools>

                                </pools>

                                <caches>

                                    <cache name="simple" aliases="NoPassivationCache"/>

                                    <cache name="passivating" passivation-store-ref="file" aliases="SimpleStatefulCache"/>

                                </caches>

                                <passivation-stores>

                                    <file-passivation-store name="file"/>

                                </passivation-stores>

                                <async thread-pool-name="default"/>

                                <timer-service thread-pool-name="default">

                                    <data-store path="timer-service-data" relative-to="jboss.server.data.dir"/>

                                </timer-service>

                                <remote connector-ref="remoting-connector" thread-pool-name="default"/>

                                <thread-pools>

                                    <thread-pool name="default">

                                        <max-threads count="10"/>

                                        <keepalive-time time="100" unit="milliseconds"/>

                                    </thread-pool>

                                </thread-pools>

                                <default-security-domain value="other"/>

                                <default-missing-method-permissions-deny-access value="true"/>

                            </subsystem>

                            <subsystem xmlns="urn:jboss:domain:infinispan:1.4">

                                <cache-container name="web" aliases="standard-session-cache" default-cache="local-web" module="org.jboss.as.clustering.web.infinispan">

                                    <local-cache name="local-web" batching="true">

                                        <file-store passivation="false" purge="false"/>

                                    </local-cache>

                                </cache-container>

                                <cache-container name="hibernate" default-cache="local-query" module="org.jboss.as.jpa.hibernate:4">

                                    <local-cache name="entity">

                                        <transaction mode="NON_XA"/>

                                        <eviction strategy="LRU" max-entries="10000"/>

                                        <expiration max-idle="100000"/>

                                    </local-cache>

                                    <local-cache name="local-query">

                                        <transaction mode="NONE"/>

                                        <eviction strategy="LRU" max-entries="10000"/>

                                        <expiration max-idle="100000"/>

                                    </local-cache>

                                    <local-cache name="timestamps">

                                        <transaction mode="NONE"/>

                                        <eviction strategy="NONE"/>

                                    </local-cache>

                                </cache-container>

                            </subsystem>

                            <subsystem xmlns="urn:jboss:domain:jaxrs:1.0"/>

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

                                <archive-validation enabled="true" fail-on-error="true" fail-on-warn="false"/>

                                <bean-validation enabled="true"/>

                                <default-workmanager>

                                    <short-running-threads>

                                        <core-threads count="50"/>

                                        <queue-length count="50"/>

                                        <max-threads count="50"/>

                                        <keepalive-time time="10" unit="seconds"/>

                                    </short-running-threads>

                                    <long-running-threads>

                                        <core-threads count="50"/>

                                        <queue-length count="50"/>

                                        <max-threads count="50"/>

                                        <keepalive-time time="10" unit="seconds"/>

                                    </long-running-threads>

                                </default-workmanager>

                                <cached-connection-manager/>

                            </subsystem>

                            <subsystem xmlns="urn:jboss:domain:jdr:1.0"/>

                            <subsystem xmlns="urn:jboss:domain:jmx:1.3">

                                <expose-resolved-model/>

                                <expose-expression-model/>

                                <remoting-connector/>

                            </subsystem>

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

                                <jpa default-datasource="" default-extended-persistence-inheritance="DEEP"/>

                            </subsystem>

                            <subsystem xmlns="urn:jboss:domain:jsf:1.0"/>

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

                                <mail-session jndi-name="java:jboss/mail/Default">

                                    <smtp-server outbound-socket-binding-ref="mail-smtp"/>

                                </mail-session>

                            </subsystem>

                            <subsystem xmlns="urn:jboss:domain:naming:1.4">

                                <remote-naming/>

                            </subsystem>

                            <subsystem xmlns="urn:jboss:domain:pojo:1.0"/>

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

                                <connector name="remoting-connector" socket-binding="remoting" security-realm="ApplicationRealm"/>

                            </subsystem>

                            <subsystem xmlns="urn:jboss:domain:resource-adapters:1.1"/>

                            <subsystem xmlns="urn:jboss:domain:sar:1.0"/>

                            <subsystem xmlns="urn:jboss:domain:security:1.2">

                                <security-domains>

                                    <security-domain name="other" cache-type="default">

                                        <authentication>

                                            <login-module code="Remoting" flag="optional">

                                                <module-option name="password-stacking" value="useFirstPass"/>

                                            </login-module>

                                            <login-module code="RealmDirect" flag="required">

                                                <module-option name="password-stacking" value="useFirstPass"/>

                                            </login-module>

                                        </authentication>

                                    </security-domain>

                                    <security-domain name="jboss-web-policy" cache-type="default">

                                        <authorization>

                                            <policy-module code="Delegating" flag="required"/>

                                        </authorization>

                                    </security-domain>

                                    <security-domain name="jboss-ejb-policy" cache-type="default">

                                        <authorization>

                                            <policy-module code="Delegating" flag="required"/>

                                        </authorization>

                                    </security-domain>

                                </security-domains>

                            </subsystem>

                            <subsystem xmlns="urn:jboss:domain:threads:1.1"/>

                            <subsystem xmlns="urn:jboss:domain:transactions:1.4">

                                <core-environment>

                                    <process-id>

                                        <uuid/>

                                    </process-id>

                                </core-environment>

                                <recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/>

                                <coordinator-environment default-timeout="300"/>

                            </subsystem>

                            <subsystem xmlns="urn:jboss:domain:web:1.5" default-virtual-server="default-host" native="false">

                                <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>

                                <virtual-server name="default-host" enable-welcome-root="true">

                                    <alias name="localhost"/>

                                    <alias name="example.com"/>

                                </virtual-server>

                            </subsystem>

                            <subsystem xmlns="urn:jboss:domain:webservices:1.2">

                                <modify-wsdl-address>true</modify-wsdl-address>

                                <wsdl-host>${jboss.bind.address:127.0.0.1}</wsdl-host>

                                <endpoint-config name="Standard-Endpoint-Config"/>

                                <endpoint-config name="Recording-Endpoint-Config">

                                    <pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM">

                                        <handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/>

                                    </pre-handler-chain>

                                </endpoint-config>

                                <client-config name="Standard-Client-Config"/>

                            </subsystem>

                            <subsystem xmlns="urn:jboss:domain:weld:1.0"/>

                        </profile>

                     

                     

                        <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:127.0.0.1}"/>

                            </interface>

                            <interface name="unsecure">

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

                            </interface>

                        </interfaces>

                     

                     

                        <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-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="messaging" port="5445"/>

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

                            <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>

                        </socket-binding-group>

                     

                     

                        <deployments>

                            <deployment name="ServerConfig.jar" runtime-name="ServerConfig.jar">

                                <content sha1="0adfaa11d7881a5a733b530d3819e2e4c82d3fcc"/>

                            </deployment>

                        </deployments>

                    </server>

                    ***********************************************************************************************************

                    i am not starting server from command line instead starting from eclipse juno as i have added jboss AS 7.1 there.

                    • 7. Re: Re: Unable to connect create netty connection (HornetQ 2.3.1 Final + JBoss EAP 6.1)
                      jbertram

                                      <connectors>

                                          <netty-connector name="netty" socket-binding="messaging">

                                              <param key="port" value="${hornetq.remoting.netty.port:5445}"/>

                                              <param key="host" value="${hornetq.remoting.netty.host:127.0.0.1}"/>

                                          </netty-connector>

                                          <netty-connector name="netty-throughput" socket-binding="messaging-throughput">

                                              <param key="batch-delay" value="50"/>

                                              <param key="port" value="${hornetq.remoting.netty.port:5445}"/>

                                              <param key="host" value="${hornetq.remoting.netty.host:127.0.0.1}"/>

                                          </netty-connector>

                                          <in-vm-connector name="in-vm" server-id="0"/>

                                      </connectors>

                      This configuration is a bit puzzling to me.  Why specify both the socket-binding and the host & port params?  It's unnecessary and confusing in my opinion.  I recommend you use the default configuration, i.e.:

                       

                                      <connectors>
                                          <netty-connector name="netty" socket-binding="messaging"/>
                                          <netty-connector name="netty-throughput" socket-binding="messaging-throughput">
                                              <param key="batch-delay" value="50"/>
                                          </netty-connector>
                                          <in-vm-connector name="in-vm" server-id="0"/>
                                      </connectors>
                      

                       

                      i am not starting server from command line instead starting from eclipse juno as i have added jboss AS 7.1 there.

                      Well then how is Eclipse starting the server?  Is it passing any parameters?

                       

                      Previously you said, "...i bind netty connector to my ip of machine i was still hitting the same problem. even for interfaces "public" and "management" i bind to ip of my machine."  However, I don't see any evidence of that in this configuration file.  Please elaborate on what you're doing to bind the "netty" connector to the IP of your machine.

                      • 8. Re: Unable to connect create netty connection (HornetQ 2.3.1 Final + JBoss EAP 6.1)
                        sarfaraz-alam.md

                        Hi Justin,

                         

                         

                        Originally i was using the same connector config as you pasted above, but i was getting the same issue. After i  saw the post of this forum and changed my connector config where netty connector host pointed to 127.0.0.1. I also tried to point the netty connector host to ip of  my machine   like this:

                         

                         

                        <netty-connector name="netty" socket-binding="messaging">

                                                <param key="port" value="${hornetq.remoting.netty.port: 5445}"/>

                                                <param key="host" value="${hornetq.remoting.netty.host: 192.168.56.1}"/>

                            </netty-connector>

                         

                         

                        but it didn't work.

                         

                         

                        In Eclipse i have added jboss server only without passing any parameter and it took all details from standalone.xml file itself.  does it require to pass any parameter while starting jboss server???

                        • 9. Re: Re: Unable to connect create netty connection (HornetQ 2.3.1 Final + JBoss EAP 6.1)
                          jbertram

                          Originally i was using the same connector config as you pasted above, but i was getting the same issue. After i  saw the post of this forum and changed my connector config where netty connector host pointed to 127.0.0.1. I also tried to point the netty connector host to ip of  my machine  like this:

                           

                           

                          <netty-connector name="netty" socket-binding="messaging">

                                                  <param key="port" value="${hornetq.remoting.netty.port: 5445}"/>

                                                  <param key="host" value="${hornetq.remoting.netty.host: 192.168.56.1}"/>

                              </netty-connector>

                          Couple of things...

                           

                          If you really wanted to use the host & port params you should use the more basic <connector> rather than <netty-connector>, e.g.:

                           

                                <connector name="netty">
                                  <param key="host" value="my.host"/>
                                  <param key="port" value="5445"/>
                                </connector>
                          

                          If you use the <netty-connector> it's quite likely that the host & port params will simply be ignored and the connector will be constructed using the information from the socket-binding instead.

                           

                          However, that's probably not the best way to solve your problem.

                           

                          The first order here is to determine why you're seeing this message:

                           

                          HQ121005: Invalid "host" value "0.0.0.0" detected for "netty" connector. Switching to "MDSA1". If this new address is incorrect please manually configure the connector to use the proper one.
                          

                           

                          Something somewhere is telling the server to use 0.0.0.0.  JBoss AS will not by to 0.0.0.0 by itself.

                           

                          Why don't you try starting JBoss AS outside of Eclipse and see how that goes?

                          • 10. Re: Re: Unable to connect create netty connection (HornetQ 2.3.1 Final + JBoss EAP 6.1)
                            sarfaraz-alam.md

                            Hello Justin,

                             

                            I started jboss using standalone.bat (out side eclipse) and deployed my project using ant script and its working fine. But my question is why its not working with eclipse??

                            • 11. Re: Unable to connect create netty connection (HornetQ 2.3.1 Final + JBoss EAP 6.1)
                              jbertram

                              But my question is why its not working with eclipse??

                              That's not a question I'm in a position to answer.  I haven't used Eclipse in years.  My guess is that whatever means you're using to start JBoss AS from within Eclipse is setting some properties or something that is influencing how the server binds to the available network interface(s).

                              • 12. Re: Unable to connect create netty connection (HornetQ 2.3.1 Final + JBoss EAP 6.1)
                                sarfaraz-alam.md

                                Hi Justin,

                                 

                                I have created an EAR file in eclipse  and added the jar file carrying message driven bean and a war file carrying a client servlet to it and restarted the server. even though i am getting the same info on eclipse console like: 


                                HQ121005: Invalid "host" value "0.0.0.0" detected for "netty" connector. Switching to "MDSA1". If this new address is incorrect please manually configure the connector to use the proper one. 


                                i am able to hit the jms remotely via a standalone java program using "remote://localhost:4447" and able to receive the message sent inside message driven bean as well as using a servlet.

                                • 13. Re: Unable to connect create netty connection (HornetQ 2.3.1 Final + JBoss EAP 6.1)
                                  jbertram

                                  To summarize...Everything works as expected outside Eclipse, but not inside Eclipse.  If that's the case then I would conclude Eclipse is altering the environment somehow as I stated before.  There's not much I can help you with in that event.

                                  • 14. Re: Unable to connect create netty connection (HornetQ 2.3.1 Final + JBoss EAP 6.1)
                                    sarfaraz-alam.md

                                    Hi Justin,

                                     

                                    I have been struggling from 2 days with the programmatic access of MBeans under JBoss AS 7.1 via jmx to find servername, hostname and port. Actually i am migrating my application from weblogic 10.3.6 to jboss AS 7.1. While in case of weblogic i was doing like this to get the desire servername, hostname and port via jmx programmatically :



                                    ObjectName service = new ObjectName(

                                             "com.bea:Name=RuntimeService,Type=weblogic.management.mbeanservers.runtime.RuntimeServiceMBean");

                                      InitialContext initialContext = new InitialContext();

                                      MBeanServer server = (MBeanServer) initialContext.lookup("java:comp/env/jmx/runtime");

                                      ObjectName runtime = (ObjectName) server.getAttribute(service, "ServerRuntime");

                                      String rawHostName = (String) server.getAttribute(runtime, "ListenAddress");

                                      String serverName = (String) server.getAttribute(runtime, "Name");

                                      Integer serverPort = (Integer) server.getAttribute(runtime, "ListenPort");

                                      String hostName = rawHostName.substring(0, rawHostName.indexOf('/'));

                                      LoadConfiguration.LOGGER.debug("setUpServerVariables serverName: {}", serverName);

                                      LoadConfiguration.LOGGER.debug("setUpServerVariables serverPort: {}", serverPort);

                                      LoadConfiguration.LOGGER.debug("setUpServerVariables rawHostName: {}", rawHostName);

                                      LoadConfiguration.LOGGER.debug("setUpServerVariables hostName: {}", hostName);

                                      System.setProperty("WEBLOGIC_HOST_NAME", hostName);

                                      System.setProperty("WEBLOGIC_SERVER", serverName);

                                      System.setProperty("WEBLOGIC_PORT", serverPort.toString());

                                     

                                     

                                    But in case of Jboss AS 7.1 i don't know the exact object name which will give me servername, hostname and port no.  even i went to jconsole and try to search but futile .

                                    Can you plz help me here??

                                    1 2 Previous Next