Skip to content
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

ClassCastException when using NewRelicErrorLogger without the aspectj weaver #29

Closed
ivantopo opened this issue Apr 29, 2014 · 5 comments · Fixed by #31
Closed

ClassCastException when using NewRelicErrorLogger without the aspectj weaver #29

ivantopo opened this issue Apr 29, 2014 · 5 comments · Fixed by #31
Labels

Comments

@ivantopo
Copy link
Contributor

When a application is configured to use the NewRelicErrorLogger but wasn't started with the aspectj weaver the class cast fails and the error loops back into the logger, producing a infinite failure loop that eventually kills the app.

When the application is not instrumented this logger should report the error anyway, missing the TraceToken information.

Exception:
flights-catalog java.lang.ClassCastException: akka.event.Logging$Error cannot be cast to kamon.trace.TraceContextAware
flights-catalog at kamon.newrelic.NewRelicErrorLogger.notifyError(NewRelicErrorLogger.scala:33) ~[kamon-newrelic-0.3.0.jar:0.3.0]

@ivantopo
Copy link
Contributor Author

Also a warning should be logged to let the user know that probably forgot to include the weaver jvm options when starting the app.

migralito pushed a commit to migralito/Kamon that referenced this issue Apr 29, 2014
migralito pushed a commit to migralito/Kamon that referenced this issue Apr 30, 2014
in NewRelicErrorLogger without aspectJ, fixes kamon-io#29
migralito pushed a commit to migralito/Kamon that referenced this issue Apr 30, 2014
migralito pushed a commit to migralito/Kamon that referenced this issue Apr 30, 2014
dpsoft pushed a commit that referenced this issue May 1, 2014
@magro
Copy link
Contributor

magro commented Dec 9, 2014

We're running into this issue when running tests (our tests / fake app is not instrumented):

2014-12-09 14:09:21,232 ERROR [undefined][akka://KeepJobLockedSpec/system/log2-NewRelicErrorLogger] [KeepJobLockedSpec-akka.actor.default-dispatcher-6] akka.actor.OneForOneStrategy - akka.event.Logging$Error cannot be cast to kamon.trace.TraceContextAware
java.lang.ClassCastException: akka.event.Logging$Error cannot be cast to kamon.trace.TraceContextAware
        at kamon.newrelic.NewRelicErrorLogger$$anonfun$notifyError$1.apply$mcV$sp(NewRelicErrorLogger.scala:44) ~[kamon-newrelic_2.11-0.3.6-20aefb53cae46417335ede27abdb9024b21c4496.jar:0.3.6-20aefb53cae46417335ede27abdb9024b21c4496]

Looking at NewRelicErrorLogger.scala:44 there's (again) an unguarded val ctx = error.asInstanceOf[TraceContextAware].traceContext. Is this a regression, because this should be fixed by commit 6e22e6e?

@ivantopo
Copy link
Contributor Author

ivantopo commented Dec 9, 2014

You are absolutely right, let me fix that quickly.

ivantopo added a commit that referenced this issue Dec 9, 2014
@ivantopo
Copy link
Contributor Author

ivantopo commented Dec 9, 2014

@magro done, published 0.3.6-1b508ff95ea477387a0b27eae41ee7a76861928e for Scala 2.11 in our snapshots repo, have fun!

@magro
Copy link
Contributor

magro commented Dec 9, 2014

@ivantopo Great, works nicely.

ivantopo added a commit that referenced this issue Mar 9, 2020
…-advice

move appender loop instrumentation from interceptor to advice, fixes #28
ivantopo added a commit that referenced this issue Mar 29, 2020
only replace http server operation names on 404 responses, fixes #29
ivantopo pushed a commit that referenced this issue Mar 31, 2020
when not using aspectJ weaver, fixes #29
ivantopo pushed a commit that referenced this issue Mar 31, 2020
ivantopo added a commit that referenced this issue Mar 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants