Closed bhuvanalakshmi closed 9 years ago
Change @EnableMetrics
to @EnableMetrics(proxyTargetClass = true)
Your SampleDataMgmt bean likely implements an interface, and somewhere else you're referencing the class, not the interface. By default Spring AOP uses Java Dynamic Proxies when proxying a class which implements an interface, so instead of an instance of SampleDataMgmt: class SampleDataMgmt implements SomeInterface { … }
Spring will have "generated" a class class Proxy$47 implements SomeInterface { … }
.
Proxy Target Class will force that proxy to be class Proxy$47 extends SampleDataMgm { … }
Hope that helps.
Thank you, that helped.
I am using Java annotation to configure.
JVM metrics are reported in the console. But when i use @Timed annotation on another class. I am getting Bean Creation exception and application won't start. When the @Timed annotation is removed, application starts and JVM metrics are reported in the console. Is there an issue with configuration ?