Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-9133

activemq-camel gives NoClassDefFoundError: MessageHandlerMethodFactory

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: FIS 2.0
    • Fix Version/s: FIS 2.x-GA
    • Component/s: FIS-Camel
    • Labels:
      None
    • Steps to Reproduce:
      1. Unzip camel-jms.zip
      2. mvn clean spring-boot:run
    • Workaround Description:
      Hide

      Use

      		<dependency>
      			<groupId>org.springframework</groupId>
      			<artifactId>spring-messaging</artifactId>
      		</dependency>
      
      Show
      Use <dependency> <groupId>org.springframework</groupId> <artifactId>spring-messaging</artifactId> </dependency>

      Description

      This error is thrown

      Starting the Java application using /opt/run-java/run-java.sh ...
      exec java -javaagent:/opt/jolokia/jolokia.jar=config=/opt/jolokia/etc/jolokia.properties -XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:MinHeapFreeRatio=20 -XX:MaxHeapFreeRatio=40 -XX:+ExitOnOutOfMemoryError -cp . -jar /deployments/camel-jms.jar
      I> No access restrictor found, access to any MBean is allowed
      Jolokia: Agent started with URL https://10.128.1.184:8778/jolokia/ 
      
        .   ____          _            __ _ _
       /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
      ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
       \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
        '  |____| .__|_| |_|_| |_\__, | / / / /
       =========|_|==============|___/=/_/_/_/
       :: Spring Boot ::        (v1.4.7.RELEASE)
      
      09:14:55.857 [main] INFO  o.a.camel.spring.boot.FatJarRouter - Starting FatJarRouter v2.18.1.fuse-000049 on camel-jms-1-7vsbb with PID 1 (/deployments/camel-jms.jar started by ? in /deployments)
      09:14:55.862 [main] INFO  o.a.camel.spring.boot.FatJarRouter - No active profile set, falling back to default profiles: default
      09:14:55.975 [main] INFO  o.s.c.a.AnnotationConfigApplicationContext - Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@33833882: startup date [Thu Jun 28 09:14:55 UTC 2018]; root of context hierarchy
      09:14:56.553 [main] INFO  o.s.b.f.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [META-INF/spring/camel-context.xml]
      09:15:01.286 [main] WARN  o.s.c.a.AnnotationConfigApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.jms.config.internalJmsListenerAnnotationProcessor' defined in class path resource [org/springframework/jms/annotation/JmsBootstrapConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.jms.annotation.JmsListenerAnnotationBeanPostProcessor]: Factory method 'jmsListenerAnnotationProcessor' threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/messaging/handler/annotation/support/MessageHandlerMethodFactory
      09:15:01.288 [main] ERROR o.s.b.f.s.DefaultListableBeanFactory - Destroy method on bean with name 'org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor' threw an exception
      java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: org.springframework.context.annotation.AnnotationConfigApplicationContext@33833882: startup date [Thu Jun 28 09:14:55 UTC 2018]; root of context hierarchy
      	at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:414)
      	at org.springframework.context.support.ApplicationListenerDetector.postProcessBeforeDestruction(ApplicationListenerDetector.java:97)
      	at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:253)
      	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:578)
      	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:554)
      	at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:961)
      	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:523)
      	at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons(DefaultListableBeanFactory.java:968)
      	at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1030)
      	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:556)
      	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:762)
      	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:372)
      	at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
      	at org.apache.camel.spring.boot.FatJarRouter.main(FatJarRouter.java:26)
      	at io.fabric8.components.jms.Application.main(Application.java:16)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
      	at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
      	at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
      	at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:58)
      09:15:01.289 [main] ERROR o.s.b.f.s.DefaultListableBeanFactory - Destroy method on bean with name 'org.springframework.boot.autoconfigure.internalCachingMetadataReaderFactory' threw an exception
      java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: org.springframework.context.annotation.AnnotationConfigApplicationContext@33833882: startup date [Thu Jun 28 09:14:55 UTC 2018]; root of context hierarchy
      	at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:414)
      	at org.springframework.context.support.ApplicationListenerDetector.postProcessBeforeDestruction(ApplicationListenerDetector.java:97)
      	at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:253)
      	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:578)
      	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:554)
      	at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:961)
      	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:523)
      	at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons(DefaultListableBeanFactory.java:968)
      	at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1030)
      	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:556)
      	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:762)
      	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:372)
      	at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
      	at org.apache.camel.spring.boot.FatJarRouter.main(FatJarRouter.java:26)
      	at io.fabric8.components.jms.Application.main(Application.java:16)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
      	at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
      	at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
      	at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:58)
      09:15:01.294 [main] ERROR o.s.boot.SpringApplication - Application startup failed
      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.jms.config.internalJmsListenerAnnotationProcessor' defined in class path resource [org/springframework/jms/annotation/JmsBootstrapConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.jms.annotation.JmsListenerAnnotationBeanPostProcessor]: Factory method 'jmsListenerAnnotationProcessor' threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/messaging/handler/annotation/support/MessageHandlerMethodFactory
      	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599)
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1173)
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1067)
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
      	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
      	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
      	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
      	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
      	at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:223)
      	at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:703)
      	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:528)
      	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:762)
      	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:372)
      	at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
      	at org.apache.camel.spring.boot.FatJarRouter.main(FatJarRouter.java:26)
      	at io.fabric8.components.jms.Application.main(Application.java:16)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
      	at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
      	at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
      	at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:58)
      Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.jms.annotation.JmsListenerAnnotationBeanPostProcessor]: Factory method 'jmsListenerAnnotationProcessor' threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/messaging/handler/annotation/support/MessageHandlerMethodFactory
      	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)
      	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
      	... 24 common frames omitted
      Caused by: java.lang.NoClassDefFoundError: org/springframework/messaging/handler/annotation/support/MessageHandlerMethodFactory
      	at org.springframework.jms.annotation.JmsBootstrapConfiguration.jmsListenerAnnotationProcessor(JmsBootstrapConfiguration.java:47)
      	at org.springframework.jms.annotation.JmsBootstrapConfiguration$$EnhancerBySpringCGLIB$$32f8f717.CGLIB$jmsListenerAnnotationProcessor$0(<generated>)
      	at org.springframework.jms.annotation.JmsBootstrapConfiguration$$EnhancerBySpringCGLIB$$32f8f717$$FastClassBySpringCGLIB$$8ee0043.invoke(<generated>)
      	at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
      	at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:358)
      	at org.springframework.jms.annotation.JmsBootstrapConfiguration$$EnhancerBySpringCGLIB$$32f8f717.jmsListenerAnnotationProcessor(<generated>)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
      	... 25 common frames omitted
      Caused by: java.lang.ClassNotFoundException: org.springframework.messaging.handler.annotation.support.MessageHandlerMethodFactory
      	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      	at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:89)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      	... 36 common frames omitted
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  oscerd Andrea Cosentino
                  Reporter:
                  llowinge Lukáš Löwinger
                  Tester:
                  Lukáš Löwinger
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: