question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Some Scala based instrumentation tests fail on Java 11+ with Scala 2.13

See original GitHub issue

We’re seeing failures with some of our Scala related instrumentation tests (e.g. com.nr.instrumentation.akka22.test.AkkaTest) that appear to be happening only on Java 11+, which I think are likely due to this bug with Scala 2.13: scala/bug#12340

We’re seeing the same failure:

java.lang.IllegalAccessError: Update to static final field akka.pattern.package$.MODULE$ attempted from a different method (<init>) than the initializer method <clinit> 

This can be repro’d locally against main by running the following if you remove the test annotations (e.g. Java11IncompatibleTest) that were added to prevent them from running on Java 11+:

./gradlew -Ptest11 :instrumentation:akka-2.2:test --tests "com.nr.instrumentation.akka22.test.AkkaTest" --stacktrace

The following PR was submitted to prevent those tests from running on Java 11+ but we should revisit this at some point in the future to see if we can get these instrumentation tests running on Java 11+ again. https://github.com/newrelic/newrelic-java-agent/pull/481

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
vijaykrameshcommented, Dec 17, 2021

this has suddenly become a lot more urgent as everybody needs to upgrade their new relic java agent https://newrelic.com/blog/nerdlog/security-guidance-for-log4j

1reaction
hellecommented, Nov 23, 2021

Seeing the same error message after upgrading the newrelic java agent in an older akka application on java 11. Java Agent 7.2.0 works fine, 7.3.0 throws this error on startup

java.lang.IllegalAccessError: Update to static final field akka.pattern.package$.MODULE$ attempted from a different method (<init>) than the initializer method <clinit> 
	at akka.pattern.package$.<init>(package.scala:43)
	at akka.pattern.package$.<clinit>(package.scala)
	at akka.event.LoggingBus$class.akka$event$LoggingBus$$addLogger(Logging.scala:179)
	at akka.event.LoggingBus$$anonfun$4$$anonfun$apply$4.apply(Logging.scala:114)
	at akka.event.LoggingBus$$anonfun$4$$anonfun$apply$4.apply(Logging.scala:113)
	at scala.util.Success$$anonfun$map$1.apply(Try.scala:236)
...
Read more comments on GitHub >

github_iconTop Results From Across the Web

JDK Compatibility
Sometimes new JVM and JDK (Java Development Kit) versions require us to update Scala to remain compatible. Version compatibility table. JDK version, Minimum ......
Read more >
intellij idea - Error when working with AspectJ and Scala
It depends on AspectJ Compiler Tools 1.8.10 which only supports Java 8. It is not even the most recent 1.8 release, that should...
Read more >
Mockito 2.13.0 API - javadoc.io
This alternative mock maker which uses a combination of both Java instrumentation API and sub-classing rather than creating a new class to represent...
Read more >
kamon-io/Kamon - Gitter
Getting some really weird results out of the akka metrics. ... Using latest version of Kamon 2.x, Java 11 OpenJDK and Scala 2.13....
Read more >
userguide.pdf
If your Gradle build fails before running any tasks, you may be encountering problems with ... Please use the stable Java Library and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found