8 Replies Latest reply on May 12, 2010 5:30 PM by clebert.suconic

    Exception with 2.10.BETA3 need to know version of netty used

      I get the following exception:

       

      So my question is what version of netty are you using in 2.1.0.BETA3

       

      Caused by: java.lang.NoSuchMethodError: org.jboss.netty.buffer.ChannelBuffer.writeByte(I)V
          at org.hornetq.core.buffers.impl.ChannelBufferWrapper.writeByte(ChannelBufferWrapper.java:552) [hornetq-core-2.1.0.BETA3.jar:na]
          at org.hornetq.core.message.impl.MessageImpl.createBody(MessageImpl.java:928) [hornetq-core-2.1.0.BETA3.jar:na]
          at org.hornetq.core.message.impl.MessageImpl.<init>(MessageImpl.java:136) [hornetq-core-2.1.0.BETA3.jar:na]
          at org.hornetq.core.server.impl.ServerMessageImpl.<init>(ServerMessageImpl.java:79) [hornetq-core-2.1.0.BETA3.jar:na]
          at org.hornetq.core.server.management.impl.ManagementServiceImpl.sendNotification(ManagementServiceImpl.java:696) [hornetq-core-2.1.0.BETA3.jar:na]
          at org.hornetq.integration.transports.netty.NettyAcceptor.start(NettyAcceptor.java:405) [hornetq-transports-2.1.0.BETA1.jar:na]
          at org.hornetq.core.remoting.server.impl.RemotingServiceImpl.start(RemotingServiceImpl.java:224) [hornetq-core-2.1.0.BETA3.jar:na]
          at org.hornetq.core.server.impl.HornetQServerImpl.start(HornetQServerImpl.java:315) [hornetq-core-2.1.0.BETA3.jar:na]
          at org.hornetq.jms.server.impl.JMSServerManagerImpl.start(JMSServerManagerImpl.java:233) [hornetq-jms-2.1.0.BETA3.jar:na]
          at com.navteq.traffic.patterns.common.spring.hornetq.HornetQServerFactoryBean.getObject(HornetQServerFactoryBean.java:65) [traffic-patterns-common-2.0.1.7-SNAPSHOT.jar:na]
          at org.springframework.beans.factory.support.FactoryBeanRegistrySupport$1.run(FactoryBeanRegistrySupport.java:121) [spring-2.5.6.jar:2.5.6]

       

      How i instantiate the factory:

      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() );
              }

       

      In case you want my configuration:

       

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

        • 1. Re: Exception with 2.10.BETA3 need to know version of netty used
          timfox

          If you follow the install exactly as described in the quick start guide it will make sure you have the correct versions. If you're upgrading just by copying jars across - that won't work.

           

          You need to re-install fully.

          • 2. Re: Exception with 2.10.BETA3 need to know version of netty used

            I Use maven to build my project so I just need the maven version of netty you are now using.

             

            I was also curious why the maven dependencies for the various hornetq projects do not have their dependencies in it?

            • 3. Re: Exception with 2.10.BETA3 need to know version of netty used
              timfox

              You can find the versions of any component for any particular release in svn, e.g. :

               

              http://anonsvn.jboss.org/repos/hornetq/tags/HornetQ_2_1_0_Beta3/pom.xml

              • 4. Re: Exception with 2.10.BETA3 need to know version of netty used

                Thanks this is exactly what I needed.

                 

                I was wondering why the pom.xmls in the repository dont seem to have the dependencies in them?

                 

                for example


                <project>
                <modelVersion>4.0.0</modelVersion>
                <groupId>org.hornetq</groupId>
                <artifactId>hornetq-jms-client</artifactId>
                <version>2.1.0.BETA3</version>
                </project>

                 

                is all there is in the pom.

                 

                BUt i see you do have the depnedencies defined elsewhere so I am a little confused?

                • 5. Re: Exception with 2.10.BETA3 need to know version of netty used

                  I upgraded to the version of netty indicated in the url you gave me but I am still getting the same exception.

                  So I used a decompiler on the netty.jar for the class and there is in fact no such method.

                  So is it possible a different version of netty is being used?

                   

                  Caused by: java.lang.NoSuchMethodError: org.jboss.netty.buffer.ChannelBuffer.writeByte(I)V
                      at org.hornetq.core.buffers.impl.ChannelBufferWrapper.writeByte(ChannelBufferWrapper.java:552) [hornetq-core-2.1.0.BETA3.jar:na]
                      at org.hornetq.core.message.impl.MessageImpl.createBody(MessageImpl.java:928) [hornetq-core-2.1.0.BETA3.jar:na]
                      at org.hornetq.core.message.impl.MessageImpl.<init>(MessageImpl.java:136) [hornetq-core-2.1.0.BETA3.jar:na]
                      at org.hornetq.core.server.impl.ServerMessageImpl.<init>(ServerMessageImpl.java:79) [hornetq-core-2.1.0.BETA3.jar:na]
                      at org.hornetq.core.server.management.impl.ManagementServiceImpl.sendNotification(ManagementServiceImpl.java:696) [hornetq-core-2.1.0.BETA3.jar:na]
                      at org.hornetq.integration.transports.netty.NettyAcceptor.start(NettyAcceptor.java:405) [hornetq-transports-2.1.0.BETA1.jar:na]
                      at org.hornetq.core.remoting.server.impl.RemotingServiceImpl.start(RemotingServiceImpl.java:224) [hornetq-core-2.1.0.BETA3.jar:na]
                      at org.hornetq.core.server.impl.HornetQServerImpl.start(HornetQServerImpl.java:315) [hornetq-core-2.1.0.BETA3.jar:na]
                      at org.hornetq.jms.server.impl.JMSServerManagerImpl.start(JMSServerManagerImpl.java:233) [hornetq-jms-2.1.0.BETA3.jar:na]
                      at com.navteq.traffic.patterns.common.spring.hornetq.HornetQServerFactoryBean.getObject(HornetQServerFactoryBean.java:65) [traffic-patterns-common-2.0.1.7-SNAPSHOT.jar:na]
                      at org.springframework.beans.factory.support.FactoryBeanRegistrySupport$1.run(FactoryBeanRegistrySupport.java:121) [spring-2.5.6.jar:2.5.6]
                      ... 16 common frames omitted

                   

                  Here is the decompiled interface:

                  package org.jboss.netty.buffer;

                   

                  import java.io.*;
                  import java.nio.ByteBuffer;
                  import java.nio.ByteOrder;
                  import java.nio.channels.GatheringByteChannel;
                  import java.nio.channels.ScatteringByteChannel;

                   

                  // Referenced classes of package org.jboss.netty.buffer:
                  //            ChannelBufferFactory, ChannelBufferIndexFinder

                   

                  public interface ChannelBuffer
                      extends Comparable {

                   

                      public abstract ChannelBufferFactory factory();

                   

                      public abstract int capacity();

                   

                      public abstract ByteOrder order();

                   

                      public abstract int readerIndex();

                   

                      public abstract void readerIndex(int i);

                   

                      public abstract int writerIndex();

                   

                      public abstract void writerIndex(int i);

                   

                      public abstract void setIndex(int i, int j);

                   

                      public abstract int readableBytes();

                   

                      public abstract int writableBytes();

                   

                      public abstract boolean readable();

                   

                      public abstract boolean writable();

                   

                      public abstract void clear();

                   

                      public abstract void markReaderIndex();

                   

                      public abstract void resetReaderIndex();

                   

                      public abstract void markWriterIndex();

                   

                      public abstract void resetWriterIndex();

                   

                      public abstract void discardReadBytes();

                   

                      public abstract byte getByte(int i);

                   

                      public abstract short getUnsignedByte(int i);

                   

                      public abstract short getShort(int i);

                   

                      public abstract int getUnsignedShort(int i);

                   

                      public abstract int getMedium(int i);

                   

                      public abstract int getUnsignedMedium(int i);

                   

                      public abstract int getInt(int i);

                   

                      public abstract long getUnsignedInt(int i);

                   

                      public abstract long getLong(int i);

                   

                      public abstract void getBytes(int i, ChannelBuffer channelbuffer);

                   

                      public abstract void getBytes(int i, ChannelBuffer channelbuffer, int j);

                   

                      public abstract void getBytes(int i, ChannelBuffer channelbuffer, int j, int k);

                   

                      public abstract void getBytes(int i, byte abyte0[]);

                   

                      public abstract void getBytes(int i, byte abyte0[], int j, int k);

                   

                      public abstract void getBytes(int i, ByteBuffer bytebuffer);

                   

                      public abstract void getBytes(int i, OutputStream outputstream, int j)
                          throws IOException;

                   

                      public abstract int getBytes(int i, GatheringByteChannel gatheringbytechannel, int j)
                          throws IOException;

                   

                      public abstract void setByte(int i, byte byte0);

                   

                      public abstract void setShort(int i, short word0);

                   

                      public abstract void setMedium(int i, int j);

                   

                      public abstract void setInt(int i, int j);

                   

                      public abstract void setLong(int i, long l);

                   

                      public abstract void setBytes(int i, ChannelBuffer channelbuffer);

                   

                      public abstract void setBytes(int i, ChannelBuffer channelbuffer, int j);

                   

                      public abstract void setBytes(int i, ChannelBuffer channelbuffer, int j, int k);

                   

                      public abstract void setBytes(int i, byte abyte0[]);

                   

                      public abstract void setBytes(int i, byte abyte0[], int j, int k);

                   

                      public abstract void setBytes(int i, ByteBuffer bytebuffer);

                   

                      public abstract int setBytes(int i, InputStream inputstream, int j)
                          throws IOException;

                   

                      public abstract int setBytes(int i, ScatteringByteChannel scatteringbytechannel, int j)
                          throws IOException;

                   

                      public abstract void setZero(int i, int j);

                   

                      public abstract byte readByte();

                   

                      public abstract short readUnsignedByte();

                   

                      public abstract short readShort();

                   

                      public abstract int readUnsignedShort();

                   

                      public abstract int readMedium();

                   

                      public abstract int readUnsignedMedium();

                   

                      public abstract int readInt();

                   

                      public abstract long readUnsignedInt();

                   

                      public abstract long readLong();

                   

                      public abstract ChannelBuffer readBytes(int i);

                   

                      public abstract ChannelBuffer readBytes(ChannelBufferIndexFinder channelbufferindexfinder);

                   

                      public abstract ChannelBuffer readSlice(int i);

                   

                      public abstract ChannelBuffer readSlice(ChannelBufferIndexFinder channelbufferindexfinder);

                   

                      public abstract void readBytes(ChannelBuffer channelbuffer);

                   

                      public abstract void readBytes(ChannelBuffer channelbuffer, int i);

                   

                      public abstract void readBytes(ChannelBuffer channelbuffer, int i, int j);

                   

                      public abstract void readBytes(byte abyte0[]);

                   

                      public abstract void readBytes(byte abyte0[], int i, int j);

                   

                      public abstract void readBytes(ByteBuffer bytebuffer);

                   

                      public abstract void readBytes(OutputStream outputstream, int i)
                          throws IOException;

                   

                      public abstract int readBytes(GatheringByteChannel gatheringbytechannel, int i)
                          throws IOException;

                   

                      public abstract void skipBytes(int i);

                   

                      public abstract int skipBytes(ChannelBufferIndexFinder channelbufferindexfinder);

                   

                      public abstract void writeByte(byte byte0);

                   

                      public abstract void writeShort(short word0);

                   

                      public abstract void writeMedium(int i);

                   

                      public abstract void writeInt(int i);

                   

                      public abstract void writeLong(long l);

                   

                      public abstract void writeBytes(ChannelBuffer channelbuffer);

                   

                      public abstract void writeBytes(ChannelBuffer channelbuffer, int i);

                   

                      public abstract void writeBytes(ChannelBuffer channelbuffer, int i, int j);

                   

                      public abstract void writeBytes(byte abyte0[]);

                   

                      public abstract void writeBytes(byte abyte0[], int i, int j);

                   

                      public abstract void writeBytes(ByteBuffer bytebuffer);

                   

                      public abstract int writeBytes(InputStream inputstream, int i)
                          throws IOException;

                   

                      public abstract int writeBytes(ScatteringByteChannel scatteringbytechannel, int i)
                          throws IOException;

                   

                      public abstract void writeZero(int i);

                   

                      public abstract int indexOf(int i, int j, byte byte0);

                   

                      public abstract int indexOf(int i, int j, ChannelBufferIndexFinder channelbufferindexfinder);

                   

                      public abstract ChannelBuffer copy();

                   

                      public abstract ChannelBuffer copy(int i, int j);

                   

                      public abstract ChannelBuffer slice();

                   

                      public abstract ChannelBuffer slice(int i, int j);

                   

                      public abstract ChannelBuffer duplicate();

                   

                      public abstract ByteBuffer toByteBuffer();

                   

                      public abstract ByteBuffer toByteBuffer(int i, int j);

                   

                      public abstract ByteBuffer[] toByteBuffers();

                   

                      public abstract ByteBuffer[] toByteBuffers(int i, int j);

                   

                      public abstract String toString(String s);

                   

                      public abstract String toString(String s, ChannelBufferIndexFinder channelbufferindexfinder);

                   

                      public abstract String toString(int i, int j, String s);

                   

                      public abstract String toString(int i, int j, String s, ChannelBufferIndexFinder channelbufferindexfinder);

                   

                      public abstract int hashCode();

                   

                      public abstract boolean equals(Object obj);

                   

                      public abstract int compareTo(ChannelBuffer channelbuffer);

                   

                      public abstract String toString();
                  }

                  • 6. Re: Exception with 2.10.BETA3 need to know version of netty used
                    clebert.suconic

                    may the source be with you:

                     

                    http://anonsvn.jboss.org/repos/hornetq/tags/HornetQ_2_1_0_Beta3/pom.xml

                     

                     

                          <dependency>
                             <groupId>org.jboss.netty</groupId>
                             <artifactId>netty</artifactId>
                             <version>3.2.0.BETA1</version>
                          </dependency>
                    
                    • 7. Re: Exception with 2.10.BETA3 need to know version of netty used
                      leosbitto

                      Netty has a nice public static final String org.jboss.netty.util.Version.ID which could be used when the source may not be with you. There even is a convenient main method available, so you can just run this:

                      java -cp netty.jar org.jboss.netty.util.Version
                      • 8. Re: Exception with 2.10.BETA3 need to know version of netty used
                        clebert.suconic

                        Leos Bitto wrote:

                         

                        Netty has a nice public static final String org.jboss.netty.util.Version.ID which could be used when the source may not be with you. There even is a convenient main method available, so you can just run this:

                        java -cp netty.jar org.jboss.netty.util.Version

                        +1000