Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 5860A200ACA for ; Thu, 9 Jun 2016 11:33:24 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 570F7160A2B; Thu, 9 Jun 2016 09:33:24 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 7C245160A58 for ; Thu, 9 Jun 2016 11:33:23 +0200 (CEST) Received: (qmail 76591 invoked by uid 500); 9 Jun 2016 09:33:21 -0000 Mailing-List: contact issues-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list issues@camel.apache.org Received: (qmail 76575 invoked by uid 99); 9 Jun 2016 09:33:21 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Jun 2016 09:33:21 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 217092C1F69 for ; Thu, 9 Jun 2016 09:33:21 +0000 (UTC) Date: Thu, 9 Jun 2016 09:33:21 +0000 (UTC) From: "Nicola Ferraro (JIRA)" To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CAMEL-10034) Spring-boot health check causes application startup failure MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 09 Jun 2016 09:33:24 -0000 [ https://issues.apache.org/jira/browse/CAMEL-10034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15322235#comment-15322235 ] Nicola Ferraro commented on CAMEL-10034: ---------------------------------------- Great, it works! > Spring-boot health check causes application startup failure > ----------------------------------------------------------- > > Key: CAMEL-10034 > URL: https://issues.apache.org/jira/browse/CAMEL-10034 > Project: Camel > Issue Type: Bug > Components: camel-spring-boot > Affects Versions: 2.18.0 > Reporter: Nicola Ferraro > Assignee: Claus Ibsen > Priority: Minor > Fix For: 2.18.0 > > > After the introducion of the health check in CAMEL-10026, I get the attached exception on a sample application that depends on spring-boot-starter and camel-spring-boot-starter. > The problem seems to be related to the following dependency on the camel-spring-boot module: > {noformat} > > org.springframework.boot > spring-boot-actuator > true > ${spring-boot-version} > > {noformat} > The dependency is declared as *optional*, but the HealthCheck component inherits from org.springframework.boot.actuate.health.AbstractHealthIndicator. > A project importing the camel-spring-boot module does not import transitively the actuator module, so I get the exception. > If the application does not start, the dependency cannot be *optional*. > Excaption: > {noformat} > java.lang.IllegalStateException: Could not evaluate condition on org.apache.camel.spring.boot.health.CamelHealthAutoConfiguration#camelHealthIndicator due to org/springframework/boot/actuate/health/AbstractHealthIndicator not found. Make sure your own configuration does not rely on that class. This can also happen if you are @ComponentScanning a springframework package (e.g. if you put a @ComponentScan in the default package by mistake) > at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:55) ~[spring-boot-autoconfigure-1.3.5.RELEASE.jar!/:1.3.5.RELEASE] > at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:102) ~[spring-context-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] > at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForBeanMethod(ConfigurationClassBeanDefinitionReader.java:178) ~[spring-context-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] > at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:140) ~[spring-context-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] > at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:116) ~[spring-context-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] > at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:333) ~[spring-context-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] > at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:243) ~[spring-context-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] > at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:273) ~[spring-context-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] > at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:98) ~[spring-context-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] > at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:678) ~[spring-context-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] > at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:520) ~[spring-context-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] > at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766) [spring-boot-1.3.5.RELEASE.jar!/:1.3.5.RELEASE] > at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361) [spring-boot-1.3.5.RELEASE.jar!/:1.3.5.RELEASE] > at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) [spring-boot-1.3.5.RELEASE.jar!/:1.3.5.RELEASE] > at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191) [spring-boot-1.3.5.RELEASE.jar!/:1.3.5.RELEASE] > at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180) [spring-boot-1.3.5.RELEASE.jar!/:1.3.5.RELEASE] > at org.apache.camel.itest.springboot.ITestBoot.main(ITestBoot.java:29) [test.jar!/:na] > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_91] > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_91] > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_91] > at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_91] > at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:54) [test.jar!/:na] > at java.lang.Thread.run(Thread.java:745) [na:1.8.0_91] > Caused by: java.lang.NoClassDefFoundError: org/springframework/boot/actuate/health/AbstractHealthIndicator > at java.lang.ClassLoader.defineClass1(Native Method) ~[na:1.8.0_91] > at java.lang.ClassLoader.defineClass(ClassLoader.java:763) ~[na:1.8.0_91] > at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) ~[na:1.8.0_91] > at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) ~[na:1.8.0_91] > at java.net.URLClassLoader.access$100(URLClassLoader.java:73) ~[na:1.8.0_91] > at java.net.URLClassLoader$1.run(URLClassLoader.java:368) ~[na:1.8.0_91] > at java.net.URLClassLoader$1.run(URLClassLoader.java:362) ~[na:1.8.0_91] > at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_91] > at java.net.URLClassLoader.findClass(URLClassLoader.java:361) ~[na:1.8.0_91] > at org.springframework.boot.loader.LaunchedURLClassLoader.doLoadClass(LaunchedURLClassLoader.java:170) ~[test.jar!/:na] > at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:142) ~[test.jar!/:na] > at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_91] > at org.springframework.core.type.classreading.AnnotationReadingVisitorUtils.convertClassValues(AnnotationReadingVisitorUtils.java:73) ~[spring-core-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] > at org.springframework.core.type.classreading.MethodMetadataReadingVisitor.getAnnotationAttributes(MethodMetadataReadingVisitor.java:125) ~[spring-core-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] > at org.springframework.core.type.classreading.MethodMetadataReadingVisitor.getAnnotationAttributes(MethodMetadataReadingVisitor.java:118) ~[spring-core-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] > at org.springframework.core.type.classreading.MethodMetadataReadingVisitor.getAnnotationAttributes(MethodMetadataReadingVisitor.java:45) ~[spring-core-4.2.6.RELEASE.jar!/:4.2.6.RELEASE] > at org.springframework.boot.autoconfigure.condition.OnBeanCondition$BeanSearchSpec.(OnBeanCondition.java:274) ~[spring-boot-autoconfigure-1.3.5.RELEASE.jar!/:1.3.5.RELEASE] > at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchOutcome(OnBeanCondition.java:111) ~[spring-boot-autoconfigure-1.3.5.RELEASE.jar!/:1.3.5.RELEASE] > at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47) ~[spring-boot-autoconfigure-1.3.5.RELEASE.jar!/:1.3.5.RELEASE] > ... 22 common frames omitted > Caused by: java.lang.ClassNotFoundException: org.springframework.boot.actuate.health.AbstractHealthIndicator > at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_91] > at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_91] > at org.springframework.boot.loader.LaunchedURLClassLoader.doLoadClass(LaunchedURLClassLoader.java:178) ~[test.jar!/:na] > at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:142) ~[test.jar!/:na] > at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_91] > ... 41 common frames omitted > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)