OpenJDK 13 requires -XX:+AllowRedefinitionToAddDeleteMethods flag

See original GitHub issue

OpenJDK 12.0.1 with even Kotlin 1.3.40-eap-67 works fine. However, using OpenJDK 13 build 23 I get the following exception:

Exception in thread "main" java.lang.RuntimeException: java.lang.UnsupportedOperationException: class redefinition failed: attempted to add a method
        at reactor.blockhound.BlockHound$Builder.install(BlockHound.java:264)
        at reactor.blockhound.BlockHound.install(BlockHound.java:64)
        at de.hska.kunde.ApplicationKt.main(Application.kt:51)
Caused by: java.lang.UnsupportedOperationException: class redefinition failed: attempted to add a method
        at java.instrument/sun.instrument.InstrumentationImpl.retransformClasses0(Native Method)
        at java.instrument/sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:167)
        at reactor.blockhound.BlockHound$Builder.instrument(BlockHound.java:273)
        at reactor.blockhound.BlockHound$Builder.install(BlockHound.java:261)
        ... 2 more

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:6
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
KrzysztofKwiatkowskiKcommented, Feb 24, 2022

Using blockhound 1.0.6 and JDK 16.0.2 I am still getting this error and has to use the flag…

6reactions
bsideupcommented, Nov 30, 2020

@abdullahumer sure:

    tasks.withType(Test).all {
        if (JavaVersion.current().isCompatibleWith​(JavaVersion.VERSION_13)) {
            jvmArgs += [
                    "-XX:+AllowRedefinitionToAddDeleteMethods"
            ]
        }
    }
Read more comments on GitHub >

github_iconTop Results From Across the Web

Blockhound Gradle: 'You need to add '-XX:+ ... - Stack Overflow
Unfortunately gradle does not pick up the required -XX:+AllowRedefinitionToAddDeleteMethods flag. I tried it using IntelliJ's VMoptions in ...
Read more >
reactor/BlockHound - Gitter
2) When you switch to OpenJDK 13, make sure you enable the flag to allow ... 13.02 but i already set JVM Option...
Read more >
[JDK-8257726] Make -XX:+StressLdcRewrite option a diagnostic ...
"Trace flags for JVMTI functions and events") \ ... product(bool, AllowRedefinitionToAddDeleteMethods, false, \ ... links to. Commit openjdk/jdk/4d6f3181.
Read more >
Embracing Java 17: Here's What We Learned | by Sander Mak
These and other changes mean that some dependencies now require additional JVM flags such as --add-opens and -XX:+ ...
Read more >
Old src/hotspot/share/runtime/arguments.cpp
442 * -XX argument bounds checking is done in check_vm_args_consistency(). ... 524 { "AllowRedefinitionToAddDeleteMethods", JDK_Version::jdk(13), ...
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