0 Replies Latest reply on May 12, 2010 4:27 PM by George III

    Channel Closed exception with 2.1.0.BETA3

    George III Newbie

      javax.jms.JMSException: HornetQException[errorCode=2 message=Channel disconnected]
          at org.hornetq.jms.client.HornetQConnection$JMSFailureListener.connectionFailed(HornetQConnection.java:603) [hornetq-jms-2.1.0.BETA3.jar:na]
          at org.hornetq.core.client.impl.FailoverManagerImpl.callFailureListeners(FailoverManagerImpl.java:765) [hornetq-core-2.1.0.BETA3.jar:na]
          at org.hornetq.core.client.impl.FailoverManagerImpl.failoverOrReconnect(FailoverManagerImpl.java:727) [hornetq-core-2.1.0.BETA3.jar:na]
          at org.hornetq.core.client.impl.FailoverManagerImpl.handleConnectionFailure(FailoverManagerImpl.java:577) [hornetq-core-2.1.0.BETA3.jar:na]
          at org.hornetq.core.client.impl.FailoverManagerImpl.connectionDestroyed(FailoverManagerImpl.java:289) [hornetq-core-2.1.0.BETA3.jar:na]
          at org.hornetq.integration.transports.netty.NettyConnector$Listener$1.run(NettyConnector.java:682) [hornetq-transports-2.1.0.BETA1.jar:na]
          at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:96) [hornetq-core-2.1.0.BETA3.jar:na]
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [na:1.6.0_10]
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.6.0_10]
          at java.lang.Thread.run(Unknown Source) [na:1.6.0_10]

       

      My Factory intialization:

       

      FileConfiguration configuration = new FileConfiguration();

       

              configuration.setConfigurationUrl( "HornetQConfiguration.xml" );
              configuration.setPersistenceEnabled( false );
              configuration.setSecurityEnabled( false );
              configuration.setConnectionTTLOverride( Long.MAX_VALUE );
              configuration.start();

       

              hornetQServer = new HornetQServerImpl( configuration );

       

              jmsServerManager = new JMSServerManagerImpl( hornetQServer );
              jmsServerManager.setContext( null );
             
              jmsServerManager.start();
              hornetQServer.start();

       


              if ( ! jmsServerManager.createTopic( true, discoveryTopic.getTopicName(), discoveryTopic.getTopicName() ) )
              {
                  throw new IllegalStateException( "Failed to make topic " + discoveryTopic.getTopicName() );
              }

       

              if ( ! jmsServerManager.createTopic( true, communicationTopic.getTopicName(), communicationTopic.getTopicName() ) )
              {
                  throw new IllegalStateException( "Failed to make topic " + communicationTopic.getTopicName() );
              }

       

      HornetQConfiguration.xml

      <configuration xmlns="urn:hornetq"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd">
         <clustered>true</clustered>

       

         <!-- Connectors -->

       

         <connectors>
            <connector name="netty-connector">
               <factory-class>org.hornetq.integration.transports.netty.NettyConnectorFactory</factory-class>
               <param key="host" value="10.8.231.247"/>
               <param key="port" value="5446"/>
               <param key="use-nio" value="true"/>
            </connector>
         </connectors>
        
         <!-- Acceptors -->
         <acceptors>
            <acceptor name="netty-acceptor">
               <factory-class>org.hornetq.integration.transports.netty.NettyAcceptorFactory</factory-class>
               <param key="host" value="10.8.231.247"/>
               <param key="port" value="5445"/>
               <param key="use-nio" value="true"/>
            </acceptor>
            <!-- acceptor name="invm-acceptor">
               <factory-class>org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory</factory-class>        
            </acceptor -->
         </acceptors>
        
         <!-- Clustering configuration -->
         <broadcast-groups>
            <broadcast-group name="my-broadcast-group">
               <group-address>231.7.7.7</group-address>
               <group-port>9876</group-port>
               <broadcast-period>100</broadcast-period>
              <connector-ref connector-name="netty-connector"/>
           </broadcast-group>
         </broadcast-groups>
        
         <discovery-groups>
            <discovery-group name="my-discovery-group">
               <group-address>231.7.7.7</group-address>
               <group-port>9877</group-port>
               <refresh-timeout>10000</refresh-timeout>
            </discovery-group>
         </discovery-groups>
        
         <cluster-connections>
            <cluster-connection name="my-cluster">
               <address>jms</address>
               <retry-interval>500</retry-interval>
               <use-duplicate-detection>true</use-duplicate-detection>
               <forward-when-no-consumers>true</forward-when-no-consumers>
               <max-hops>1</max-hops>
               <discovery-group-ref discovery-group-name="my-discovery-group"/>
            </cluster-connection>
         </cluster-connections>
        
         <!-- Other config -->
         <address-settings>    
           <address-setting match="jms.#">
             <redistribution-delay>0</redistribution-delay>
             <dead-letter-address>jms.queue.deadLetterQueue</dead-letter-address>
             <max-delivery-attempts>3</max-delivery-attempts>
             <redelivery-delay>5000</redelivery-delay>
             <last-value-queue>true</last-value-queue>       
             <address-full-policy>PAGE</address-full-policy>
           </address-setting>
      </address-settings>

       

         <!-- security-settings>
           
            <security-setting match="jms.queue.exampleQueue">
               <permission type="createDurableQueue" roles="guest"/>
               <permission type="deleteDurableQueue" roles="guest"/>
               <permission type="createTempQueue" roles="guest"/>
               <permission type="deleteTempQueue" roles="guest"/>
               <permission type="consume" roles="guest"/>
               <permission type="send" roles="guest"/>
            </security-setting>
         </security-settings -->

       

      </configuration>