Spring AMQP
  1. Spring AMQP
  2. AMQP-194

java.lang.ClassNotFoundException: com.rabbitmq.client.impl.LongString

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Works as Designed
    • Affects Version/s: 1.0.0 GA
    • Fix Version/s: None
    • Component/s: RabbitMQ
    • Labels:

      Description

      It's not possible to use spring-rabbit 1.0.0.RELEASE with amqp-client version 2.6.1.
      Here is the exception log:

      Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'rabbitTemplate' defined in class path resource [com
      /erp/config/AMQPConfiguration.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException
      : Factory method [public org.springframework.amqp.rabbit.core.RabbitTemplate com.erp.config.AMQPConfiguration.rabbitTemplate()] threw exception; neste
      d exception is java.lang.NoClassDefFoundError: com/rabbitmq/client/impl/LongString
      at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:581)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java
      :983)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:879)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
      at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:265)
      at com.erp.config.AMQPConfiguration$$EnhancerByCGLIB$$b2a07f4e.rabbitTemplate(<generated>)
      at com.erp.config.AMQPConfiguration.requestServiceGateway(AMQPConfiguration.java:74)
      at com.erp.config.AMQPConfiguration$$EnhancerByCGLIB$$b2a07f4e.CGLIB$requestServiceGateway$5(<generated>)
      at com.erp.config.AMQPConfiguration$$EnhancerByCGLIB$$b2a07f4e$$FastClassByCGLIB$$1c089aae.invoke(<generated>)
      at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
      at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:253)
      at com.erp.config.AMQPConfiguration$$EnhancerByCGLIB$$b2a07f4e.requestServiceGateway(<generated>)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:149)
      ... 43 more

      I checked org.springframework.amqp.rabbit.support.DefaultMessagePropertiesConverter soure, and found the following import:
      import com.rabbitmq.client.impl.LongString;

      This class was moved to com.rabbitmq.client package since amqp-client 2.6.0

        Issue Links

          Activity

          Hide
          Mike Smith added a comment -

          I just bumped into this problem too. Would really prefer to use the 2.6.1 rabbitmq codebase if possible (rather than 2.5.0 as is currently specified in spring-amqp-parent pom).

          Show
          Mike Smith added a comment - I just bumped into this problem too. Would really prefer to use the 2.6.1 rabbitmq codebase if possible (rather than 2.5.0 as is currently specified in spring-amqp-parent pom).
          Hide
          Mark Fisher added a comment -

          The 1.0.0.RELEASE uses the 2.5 client, and 2.6 is not merely swappable. We have created AMQP-195 for the upgrade of the underlying client version in an upcoming version.

          Show
          Mark Fisher added a comment - The 1.0.0.RELEASE uses the 2.5 client, and 2.6 is not merely swappable. We have created AMQP-195 for the upgrade of the underlying client version in an upcoming version.

            People

            • Assignee:
              Mark Fisher
              Reporter:
              Sergei
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: