java.lang.NoClassDefFoundError: com/rabbitmq/client/impl/LongString

Spring JIRA | Sergei | 5 years ago
  1. 0

    It's not possible to use spring-rabbit 1.0.0.RELEASE with amqp-client version 2.6.1. Here is the exception log: {quote} 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 {quote} 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

    Spring JIRA | 5 years ago | Sergei
    java.lang.NoClassDefFoundError: com/rabbitmq/client/impl/LongString
  2. 0

    It's not possible to use spring-rabbit 1.0.0.RELEASE with amqp-client version 2.6.1. Here is the exception log: {quote} 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 {quote} 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

    Spring JIRA | 5 years ago | Sergei
    java.lang.NoClassDefFoundError: com/rabbitmq/client/impl/LongString
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Not deployable to OSGi environment

    GitHub | 2 years ago | GoogleCodeExporter
    java.lang.NoClassDefFoundError: Lnet/sf/ehcache/CacheManager;

  1. linxiaolong 1 times, last 4 months ago
4 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.NoClassDefFoundError

    com/rabbitmq/client/impl/LongString

    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod()
  2. Spring Beans
    AbstractBeanFactory.getBean
    1. org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:581)
    2. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:983)
    3. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:879)
    4. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
    5. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    6. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
    7. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
    8. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
    9. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    9 frames
  3. Spring Context
    ConfigurationClassEnhancer$BeanMethodInterceptor.intercept
    1. org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:265)
    1 frame
  4. com.erp.config
    AMQPConfiguration$$EnhancerByCGLIB$$b2a07f4e$$FastClassByCGLIB$$1c089aae.invoke
    1. com.erp.config.AMQPConfiguration$$EnhancerByCGLIB$$b2a07f4e.rabbitTemplate(<generated>)
    2. com.erp.config.AMQPConfiguration.requestServiceGateway(AMQPConfiguration.java:74)
    3. com.erp.config.AMQPConfiguration$$EnhancerByCGLIB$$b2a07f4e.CGLIB$requestServiceGateway$5(<generated>)
    4. com.erp.config.AMQPConfiguration$$EnhancerByCGLIB$$b2a07f4e$$FastClassByCGLIB$$1c089aae.invoke(<generated>)
    4 frames
  5. IDEA
    MethodProxy.invokeSuper
    1. net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
    1 frame
  6. Spring Context
    ConfigurationClassEnhancer$BeanMethodInterceptor.intercept
    1. org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:253)
    1 frame
  7. com.erp.config
    AMQPConfiguration$$EnhancerByCGLIB$$b2a07f4e.requestServiceGateway
    1. com.erp.config.AMQPConfiguration$$EnhancerByCGLIB$$b2a07f4e.requestServiceGateway(<generated>)
    1 frame
  8. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    4. java.lang.reflect.Method.invoke(Method.java:597)
    4 frames
  9. Spring Beans
    SimpleInstantiationStrategy.instantiate
    1. org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:149)
    1 frame