-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WeavedMethod annotation on constructor #1153
Comments
Hi @thiagosardinha, It is being generated now and should be available in a few minutes at: |
Hi @meiao. Thanks for the quick response! Tested the custom jar and seems to have worked for
My guess is the same fix would have to be applied to it too. |
Sorry, I overlooked your comment at the bottom about @InstrumentedMethod. |
That worked! Thanks! |
I have a Java 11 application with Dropwizard framework that implements some Quartz jobs.
After bumping Dropwizard's version from 2.1.1 to 2.1.4 the application stopped working when using the New Relic Java agent (tested with versions 7.10.0 and 8.0.0). After a lot of debugging, I tracked down that Dropwizard's new version changed its proxy implementation from
javassist
tobytebuddy
and the latter has a validation that does not allow elements with annotations that don't target it.Problem is, New Relic Java agent annotates my Quartz jobs implementations' constructors with the
@WeaveMethod
annotation, whichbytebuddy
considers illegal state since the annotation targets only methods. This is where it fails.It's so many moving parts that I'm not even sure the issue is here, but seems that bytebuddy's validation sort of makes sense, so here I am.
Note, the job classes are also annotated with the
@InstrumentedMethod
annotation, which I assume would fail as well.Expected Behavior
Maybe include constructors as target in the
@WeaveMethod
annotation. Or use another annotation specific for constructors so targets are correct for the included annotations.Troubleshooting or NR Diag results
Exception that is raised by bytebuddy in this validation
debugging the bytebuddy shows the included annotations
validation
annotated class snippet
metrics reporters is just a wrapper to new relic
Steps to Reproduce
as I said, started happening to me after bumping Dropwizard's version to 2.1.4, but that's just because they switched from using
javassist
tobytebuddy
which has the validation I mentioned.Basically, using NR java agent in an Dropwizard 2.1.4 application with a class implementing
org.quartz.Job
.Your Environment
Additional context
More details on Dropwizard's change to bytebuddy: dropwizard/dropwizard#5748
The text was updated successfully, but these errors were encountered: