title: [Spring][Actuators] Failed to process import candidates for configuration class
body: <p>I am trying to implement actuators in my spring project (NOT spring boot). I added below dependency in my pom file:</p>
  
  <pre><code>&lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-actuator&lt;/artifactId&gt;
          &lt;version&gt;1.3.5.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>Also added the class below:</p>
  
  <pre><code>import java.util.Collection;
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.boot.actuate.autoconfigure.EndpointAutoConfiguration;
  import org.springframework.boot.actuate.autoconfigure.PublicMetricsAutoConfiguration;
  import org.springframework.boot.actuate.endpoint.MetricsEndpoint;
  import org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping;
  import org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter;
  import org.springframework.boot.actuate.endpoint.mvc.MvcEndpoint;
  import org.springframework.context.annotation.Bean;
  import org.springframework.context.annotation.Configuration;
  import org.springframework.context.annotation.Import;
  
  @Configuration
  @Import({EndpointAutoConfiguration.class, PublicMetricsAutoConfiguration.class})
  public class SpringBootActuatorConfigBindings {
  
      @Bean
      @Autowired
      public EndpointHandlerMapping endpointHandlerMapping(Collection&lt;? extends MvcEndpoint&gt; endpoints) {
          return new EndpointHandlerMapping(endpoints);
      }
  
      @Bean
      @Autowired
      public EndpointMvcAdapter metricsEndPoint(MetricsEndpoint delegate) {
          return new EndpointMvcAdapter(delegate);
      }
  }
  </code></pre>
  
  <p>But on running i am getting below error:</p>
  
  <blockquote>
    <p>[local] [] [ERROR] [2019-04-22T14:24:47,347] [     Console scanner]
    [work.web.context.ContextLoader] Context initialization failed
    org.springframework.beans.factory.BeanDefinitionStoreException: Failed
    to process import candidates for configuration class
    [com.mycompany.ans.processor.bindings.ProcessorBindings]; nested
    exception is java.lang.IllegalStateException: Failed to introspect
    annotated methods on class
    com.mycompany.ans.processor.bindings.SpringBootActuatorConfigBindings
            at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:599)
    ~[spring-context-5.1.1.RELEASE.jar:5.1.1.RELEASE]
            at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:302)
    ~[spring-context-5.1.1.RELEASE.jar:5.1.1.RELEASE]
            at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:242)
    ~[spring-context-5.1.1.RELEASE.jar:5.1.1.RELEASE]
            at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:199)
    ~[spring-context-5.1.1.RELEASE.jar:5.1.1.RELEASE]
            at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:167)
    ~[spring-context-5.1.1.RELEASE.jar:5.1.1.RELEASE]
            at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:315)
    ~[spring-context-5.1.1.RELEASE.jar:5.1.1.RELEASE]
            at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:232)
    ~[spring-context-5.1.1.RELEASE.jar:5.1.1.RELEASE]
            at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:275)
    ~[spring-context-5.1.1.RELEASE.jar:5.1.1.RELEASE]
            at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:95)
    ~[spring-context-5.1.1.RELEASE.jar:5.1.1.RELEASE]
            at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:691)
    ~[spring-context-5.1.1.RELEASE.jar:5.1.1.RELEASE]
            at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:528)
    ~[spring-context-5.1.1.RELEASE.jar:5.1.1.RELEASE]
            at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:400)
    ~[spring-web-5.1.1.RELEASE.jar:5.1.1.RELEASE]
            at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:291)
    [spring-web-5.1.1.RELEASE.jar:5.1.1.RELEASE]
            at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103)
    [spring-web-5.1.1.RELEASE.jar:5.1.1.RELEASE]
            at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:952)
    [jetty-server-9.4.12.v20180830.jar:9.4.12.v20180830]
            at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:558)
    [jetty-servlet-9.4.12.v20180830.jar:9.4.12.v20180830]
            at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:917)
    [jetty-server-9.4.12.v20180830.jar:9.4.12.v20180830]
            at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:370)
    [jetty-servlet-9.4.12.v20180830.jar:9.4.12.v20180830]
            at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1497)
    [jetty-webapp-9.4.12.v20180830.jar:9.4.12.v20180830]
            at org.eclipse.jetty.maven.plugin.JettyWebAppContext.startWebapp(JettyWebAppContext.java:360)
    [jetty-maven-plugin-9.4.12.v20180830.jar:9.4.12.v20180830]
            at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1459)
    [jetty-webapp-9.4.12.v20180830.jar:9.4.12.v20180830]
            at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:847)
    [jetty-server-9.4.12.v20180830.jar:9.4.12.v20180830]
            at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:287)
    [jetty-servlet-9.4.12.v20180830.jar:9.4.12.v20180830]
            at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:545)
    [jetty-webapp-9.4.12.v20180830.jar:9.4.12.v20180830]
            at org.eclipse.jetty.maven.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:428)
    [jetty-maven-plugin-9.4.12.v20180830.jar:9.4.12.v20180830]
            at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    [jetty-util-9.4.12.v20180830.jar:9.4.12.v20180830]
            at org.eclipse.jetty.maven.plugin.JettyRunMojo.restartWebApp(JettyRunMojo.java:517)
    [jetty-maven-plugin-9.4.12.v20180830.jar:9.4.12.v20180830]
            at org.eclipse.jetty.maven.plugin.ConsoleScanner.restartWebApp(ConsoleScanner.java:112)
    [jetty-maven-plugin-9.4.12.v20180830.jar:9.4.12.v20180830]
            at org.eclipse.jetty.maven.plugin.ConsoleScanner.checkSystemInput(ConsoleScanner.java:76)
    [jetty-maven-plugin-9.4.12.v20180830.jar:9.4.12.v20180830]
            at org.eclipse.jetty.maven.plugin.ConsoleScanner.run(ConsoleScanner.java:46)
    [jetty-maven-plugin-9.4.12.v20180830.jar:9.4.12.v20180830] Caused by:
    java.lang.IllegalStateException: Failed to introspect annotated
    methods on class
    com.mycompany.ans.processor.bindings.SpringBootActuatorConfigBindings
            at org.springframework.core.type.StandardAnnotationMetadata.getAnnotatedMethods(StandardAnnotationMetadata.java:169)
    ~[spring-core-5.1.1.RELEASE.jar:5.1.1.RELEASE]
            at org.springframework.context.annotation.ConfigurationClassParser.retrieveBeanMethodMetadata(ConfigurationClassParser.java:392)
    ~[spring-context-5.1.1.RELEASE.jar:5.1.1.RELEASE]
            at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:317)
    ~[spring-context-5.1.1.RELEASE.jar:5.1.1.RELEASE]
            at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:242)
    ~[spring-context-5.1.1.RELEASE.jar:5.1.1.RELEASE]
            at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:589)
    ~[spring-context-5.1.1.RELEASE.jar:5.1.1.RELEASE]
            ... 29 more Caused by: java.lang.NoClassDefFoundError: org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerMapping
            at java.lang.ClassLoader.defineClass1(Native Method) ~[?:1.8.0_202]
            at java.lang.ClassLoader.defineClass(ClassLoader.java:763) ~[?:1.8.0_202]
            at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    ~[?:1.8.0_202]
            at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
    ~[?:1.8.0_202]
            at java.net.URLClassLoader.access$100(URLClassLoader.java:74) ~[?:1.8.0_202]
            at java.net.URLClassLoader$1.run(URLClassLoader.java:369) ~[?:1.8.0_202]
            at java.net.URLClassLoader$1.run(URLClassLoader.java:363) ~[?:1.8.0_202]
            at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_202]
            at java.net.URLClassLoader.findClass(URLClassLoader.java:362) ~[?:1.8.0_202]
            at org.eclipse.jetty.webapp.WebAppClassLoader.foundClass(WebAppClassLoader.java:649)
    ~[?:?]
            at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:555)
    ~[?:?]
            at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_202]
            at java.lang.Class.getDeclaredMethods0(Native Method) ~[?:1.8.0_202]
            at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) ~[?:1.8.0_202]
            at java.lang.Class.getDeclaredMethods(Class.java:1975) ~[?:1.8.0_202]
            at org.springframework.core.type.StandardAnnotationMetadata.getAnnotatedMethods(StandardAnnotationMetadata.java:158)
    ~[spring-core-5.1.1.RELEASE.jar:5.1.1.RELEASE]
            at org.springframework.context.annotation.ConfigurationClassParser.retrieveBeanMethodMetadata(ConfigurationClassParser.java:392)
    ~[spring-context-5.1.1.RELEASE.jar:5.1.1.RELEASE]
            at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:317)
    ~[spring-context-5.1.1.RELEASE.jar:5.1.1.RELEASE]
            at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:242)
    ~[spring-context-5.1.1.RELEASE.jar:5.1.1.RELEASE]
            at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:589)
    ~[spring-context-5.1.1.RELEASE.jar:5.1.1.RELEASE]</p>
  </blockquote>
  
  <p>Where i am missing.</p>