Closed gresrun closed 10 years ago
Hi,
Thanks a lot for the detailed report.
The root cause of the exception that you're facing originates from the improper handling of multiple Metrics annotations for a single method.
I implemented that proper support for multiple Metrics annotation per method in commit 507235c and released version 1.0.0-rc.4
on Maven Central so that you can test the fix.
Let me know if that addresses your error case and if you need further assistance.
Hmmm. I upgraded to RC4 but now I can't even get the application to start because I get this error:
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.clarecontrols.licensing.cliq.FusionAPIFactory.build(FusionAPIFactory.java:85)
at com.clarecontrols.licensing.cliq.LicenseServerApplication.run(LicenseServerApplication.java:83)
at com.clarecontrols.licensing.cliq.LicenseServerApplication.run(LicenseServerApplication.java:1)
at io.dropwizard.cli.EnvironmentCommand.run(EnvironmentCommand.java:42)
at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:76)
at io.dropwizard.cli.Cli.run(Cli.java:70)
at io.dropwizard.Application.run(Application.java:72)
at com.clarecontrols.licensing.cliq.LicenseServerApplication.main(LicenseServerApplication.java:46)
Caused by: javax.el.PropertyNotFoundException: ELResolver cannot handle a null base Object with identifier 'this'
at com.sun.el.lang.ELSupport.throwUnhandled(ELSupport.java:68)
at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:126)
at com.sun.el.parser.AstValue.getBase(AstValue.java:151)
at com.sun.el.parser.AstValue.getValue(AstValue.java:200)
at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:226)
at javax.el.ELProcessor.getValue(ELProcessor.java:129)
at javax.el.ELProcessor.eval(ELProcessor.java:115)
at org.stefanutti.metrics.aspectj.JavaxElMetricStrategy.resolveMetricRegistry(JavaxElMetricStrategy.java:42)
at org.stefanutti.metrics.aspectj.MetricStaticAspect.ajc$after$org_stefanutti_metrics_aspectj_MetricStaticAspect$1$be47261c(MetricStaticAspect.aj:47)
at com.clarecontrols.licensing.cliq.service.impl.FusionAPIImpl.<clinit>(FusionAPIImpl.java:45)
... 8 more
Same configuration and code samples as before. :frowning:
My mistake :-( I added the evaluation of the Metrics registry EL expression at class level though that leads to throwing that error when the class is having both non-static and static methods.
I've just reverted back to the previous behavior in commit a65d064 and added unit tests for that use case.
Would you mind testing your error case based on the head revision of the master
branch before I release a newer version this time? ;-) Let me know otherwise I'll trigger a new release.
See #6
I'm getting the following bizarre exception at runtime:
I'm trying to use this project to provide metrics around API calls that I am making inside of a Dropwizard environment (which handles metrics). Timers work but Meters fail with the above error.
I am building using Maven; below is a cut-down version of of the POM with the relevant parts:
The service implementation that I'm instrumenting:
Any ideas as to the cause of this? Thanks!