I've updated Spring boot version from 2.3.0 to 2.3.1 and my application stopped starting with next error:
Exception in thread "main" java.lang.NoClassDefFoundError: net/bytebuddy/agent/ByteBuddyAgent
at reactor.tools.agent.ReactorDebugAgent.init(ReactorDebugAgent.java:56)
at com.XXXApplicationKt.main(CampaignRefundApplication.kt:13)
Caused by: java.lang.ClassNotFoundException: net.bytebuddy.agent.ByteBuddyAgent
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 2 more
Comment From: bclozel
I've created a sample application with WebFlux and reactor-tools as dependencies and I'm not getting this exception.
Could you provide a sample application showing the problem?
Since there was an upgrade for the ByteBuddy dependency, this might be a case of locally corrupted jar. If you're using maven, you can try and re-resolve dependencies in your projects with mvn dependency:purge-local-repository
.
Comment From: wilkinsona
This looks a lot like https://github.com/reactor/reactor-core/issues/2189. @s4got10dev, are you using Gradle to build your app?
Comment From: s4got10dev
@wilkinsona yes, I'm using gradle. Thanks for pointing that issue, for me it also looks like that is the root cause of my problem.
Comment From: s4got10dev
@bclozel such a project -> https://start.spring.io/#!type=gradle-project&language=kotlin&platformVersion=2.3.1.RELEASE&packaging=jar&jvmVersion=11&groupId=com.example&artifactId=demo&name=demo&description=Demo%20project%20for%20Spring%20Boot&packageName=com.example.demo&dependencies=webflux
with implementation("io.projectreactor:reactor-tools")
dependency and ReactorDebugAgent.init()
inside main
method will cause same error
Comment From: wilkinsona
Thanks for the confirmation, @s4got10dev. We’ll pick up a new version of Reactor with the correct metadata in due course. In the meantime the Reactor issue includes a workaround that you can use.