Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Not working when upgrading to Spring Boot 1.4 #189

Open
nickcodefresh opened this issue Aug 26, 2016 · 3 comments
Open

Not working when upgrading to Spring Boot 1.4 #189

nickcodefresh opened this issue Aug 26, 2016 · 3 comments

Comments

@nickcodefresh
Copy link

If I upgrade to Spring Boot 1.4 I get the following exception on startup. Thought it might have been linked to #184, but I tried removing @EnableMetrics from my configuration class but it still didn't fix the issue.

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'exceptionMeteredAnnotationBeanPostProcessor' defined in class path resource [com/ryantenney/metrics/spring/config/annotation/DelegatingMetricsConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.beans.factory.config.BeanPostProcessor]: Factory method 'exceptionMeteredAnnotationBeanPostProcessor' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'getMetricRegistry' defined in class path resource [com/ryantenney/metrics/spring/config/annotation/DelegatingMetricsConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.codahale.metrics.MetricRegistry]: Factory method 'getMetricRegistry' threw exception; nested exception is java.lang.IllegalStateException: Failed to introspect annotations on public com.codahale.metrics.MetricRegistry com.ryantenney.metrics.spring.config.annotation.DelegatingMetricsConfiguration.getMetricRegistry()
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1123)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1018)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
    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:240)
    at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:697)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:526)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:369)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:313)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1185)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1174)
    at tv.nativ.mio.events.Application.main(Application.java:55)
    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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.beans.factory.config.BeanPostProcessor]: Factory method 'exceptionMeteredAnnotationBeanPostProcessor' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'getMetricRegistry' defined in class path resource [com/ryantenney/metrics/spring/config/annotation/DelegatingMetricsConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.codahale.metrics.MetricRegistry]: Factory method 'getMetricRegistry' threw exception; nested exception is java.lang.IllegalStateException: Failed to introspect annotations on public com.codahale.metrics.MetricRegistry com.ryantenney.metrics.spring.config.annotation.DelegatingMetricsConfiguration.getMetricRegistry()
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
    ... 23 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'getMetricRegistry' defined in class path resource [com/ryantenney/metrics/spring/config/annotation/DelegatingMetricsConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.codahale.metrics.MetricRegistry]: Factory method 'getMetricRegistry' threw exception; nested exception is java.lang.IllegalStateException: Failed to introspect annotations on public com.codahale.metrics.MetricRegistry com.ryantenney.metrics.spring.config.annotation.DelegatingMetricsConfiguration.getMetricRegistry()
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1123)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1018)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
    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:197)
    at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:381)
    at com.ryantenney.metrics.spring.config.annotation.DelegatingMetricsConfiguration$$EnhancerBySpringCGLIB$$ebc91b57.getMetricRegistry(<generated>)
    at com.ryantenney.metrics.spring.config.annotation.MetricsConfigurationSupport.exceptionMeteredAnnotationBeanPostProcessor(MetricsConfigurationSupport.java:64)
    at com.ryantenney.metrics.spring.config.annotation.DelegatingMetricsConfiguration$$EnhancerBySpringCGLIB$$ebc91b57.CGLIB$exceptionMeteredAnnotationBeanPostProcessor$5(<generated>)
    at com.ryantenney.metrics.spring.config.annotation.DelegatingMetricsConfiguration$$EnhancerBySpringCGLIB$$ebc91b57$$FastClassBySpringCGLIB$$f5aaeb49.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
    at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:356)
    at com.ryantenney.metrics.spring.config.annotation.DelegatingMetricsConfiguration$$EnhancerBySpringCGLIB$$ebc91b57.exceptionMeteredAnnotationBeanPostProcessor(<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)
    ... 24 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.codahale.metrics.MetricRegistry]: Factory method 'getMetricRegistry' threw exception; nested exception is java.lang.IllegalStateException: Failed to introspect annotations on public com.codahale.metrics.MetricRegistry com.ryantenney.metrics.spring.config.annotation.DelegatingMetricsConfiguration.getMetricRegistry()
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
    ... 45 common frames omitted
Caused by: java.lang.IllegalStateException: Failed to introspect annotations on public com.codahale.metrics.MetricRegistry com.ryantenney.metrics.spring.config.annotation.DelegatingMetricsConfiguration.getMetricRegistry()
    at org.springframework.core.annotation.AnnotatedElementUtils.searchWithFindSemantics(AnnotatedElementUtils.java:1091)
    at org.springframework.core.annotation.AnnotatedElementUtils.searchWithFindSemantics(AnnotatedElementUtils.java:1060)
    at org.springframework.core.annotation.AnnotatedElementUtils.findMergedAnnotationAttributes(AnnotatedElementUtils.java:656)
    at org.springframework.core.annotation.AnnotatedElementUtils.findMergedAnnotation(AnnotatedElementUtils.java:730)
    at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:314)
    at com.ryantenney.metrics.spring.config.annotation.DelegatingMetricsConfiguration$$EnhancerBySpringCGLIB$$ebc91b57.getMetricRegistry(<generated>)
    at com.ryantenney.metrics.spring.config.annotation.MetricsConfigurerComposite.getMetricRegistry(MetricsConfigurerComposite.java:52)
    at com.ryantenney.metrics.spring.config.annotation.DelegatingMetricsConfiguration.getMetricRegistry(DelegatingMetricsConfiguration.java:59)
    at com.ryantenney.metrics.spring.config.annotation.DelegatingMetricsConfiguration$$EnhancerBySpringCGLIB$$ebc91b57.CGLIB$getMetricRegistry$2(<generated>)
    at com.ryantenney.metrics.spring.config.annotation.DelegatingMetricsConfiguration$$EnhancerBySpringCGLIB$$ebc91b57$$FastClassBySpringCGLIB$$f5aaeb49.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
    at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:356)
    at com.ryantenney.metrics.spring.config.annotation.DelegatingMetricsConfiguration$$EnhancerBySpringCGLIB$$ebc91b57.getMetricRegistry(<generated>)
    at com.ryantenney.metrics.spring.config.annotation.MetricsConfigurerComposite.getMetricRegistry(MetricsConfigurerComposite.java:52)
    at com.ryantenney.metrics.spring.config.annotation.DelegatingMetricsConfiguration.getMetricRegistry(DelegatingMetricsConfiguration.java:59)
    at com.ryantenney.metrics.spring.config.annotation.DelegatingMetricsConfiguration$$EnhancerBySpringCGLIB$$ebc91b57.CGLIB$getMetricRegistry$2(<generated>)
    at com.ryantenney.metrics.spring.config.annotation.DelegatingMetricsConfiguration$$EnhancerBySpringCGLIB$$ebc91b57$$FastClassBySpringCGLIB$$f5aaeb49.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
    at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:356)
    at com.ryantenney.metrics.spring.config.annotation.DelegatingMetricsConfiguration$$EnhancerBySpringCGLIB$$ebc91b57.getMetricRegistry(<generated>)
    at com.ryantenney.metrics.spring.config.annotation.MetricsConfigurerComposite.getMetricRegistry(MetricsConfigurerComposite.java:52)
    at com.ryantenney.metrics.spring.config.annotation.DelegatingMetricsConfiguration.getMetricRegistry(DelegatingMetricsConfiguration.java:59)
    at com.ryantenney.metrics.spring.config.annotation.DelegatingMetricsConfiguration$$EnhancerBySpringCGLIB$$ebc91b57.CGLIB$getMetricRegistry$2(<generated>)
    at com.ryantenney.metrics.spring.config.annotation.DelegatingMetricsConfiguration$$EnhancerBySpringCGLIB$$ebc91b57$$FastClassBySpringCGLIB$$f5aaeb49.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
    at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:356)
    at com.ryantenney.metrics.spring.config.annotation.DelegatingMetricsConfiguration$$EnhancerBySpringCGLIB$$ebc91b57.getMetricRegistry(<generated>)
    at com.ryantenney.metrics.spring.config.annotation.MetricsConfigurerComposite.getMetricRegistry(MetricsConfigurerComposite.java:52)
    at com.ryantenney.metrics.spring.config.annotation.DelegatingMetricsConfiguration.getMetricRegistry(DelegatingMetricsConfiguration.java:59)
    at com.ryantenney.metrics.spring.config.annotation.DelegatingMetricsConfiguration$$EnhancerBySpringCGLIB$$ebc91b57.CGLIB$getMetricRegistry$2(<generated>)
    at com.ryantenney.metrics.spring.config.annotation.DelegatingMetricsConfiguration$$EnhancerBySpringCGLIB$$ebc91b57$$FastClassBySpringCGLIB$$f5aaeb49.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
    at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:356)
    at com.ryantenney.metrics.spring.config.annotation.DelegatingMetricsConfiguration$$EnhancerBySpringCGLIB$$ebc91b57.getMetricRegistry(<generated>)
    at com.ryantenney.metrics.spring.config.annotation.MetricsConfigurerComposite.getMetricRegistry(MetricsConfigurerComposite.java:52)
    at com.ryantenney.metrics.spring.config.annotation.DelegatingMetricsConfiguration.getMetricRegistry(DelegatingMetricsConfiguration.java:59)
    at com.ryantenney.metrics.spring.config.annotation.DelegatingMetricsConfiguration$$EnhancerBySpringCGLIB$$ebc91b57.CGLIB$getMetricRegistry$2(<generated>)
    at com.ryantenney.metrics.spring.config.annotation.DelegatingMetricsConfiguration$$EnhancerBySpringCGLIB$$ebc91b57$$FastClassBySpringCGLIB$$f5aaeb49.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
@haninaguib
Copy link

I have also ran into this issue. Will try to figure a solution.

@Nocturnhabeo
Copy link

Any progress on this or a work around I am running into the same issue.

@Nocturnhabeo
Copy link

Updating to Spring boot 1.4.1 fixed the problem.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants