java.lang.IllegalStateException: Cannot resolve type description for org.slf4j.event.LoggingEvent
sergey-morenets opened this issue · comments
When I try to use BlockHound library in my Spring Boot application I get this exception when calling:
BlockHound.install();
Expected Behavior
BlockHound should successfully install.
Actual Behavior
[Byte Buddy] ERROR ch.qos.logback.classic.Logger [jdk.internal.loader.ClassLoaders$AppClassLoader@14514713, unnamed module @3b220bcb, loaded=true]
java.lang.IllegalStateException: Cannot resolve type description for org.slf4j.event.LoggingEvent
at reactor.blockhound.shaded.net.bytebuddy.pool.TypePool$Resolution$Illegal.resolve(TypePool.java:159)
at reactor.blockhound.shaded.net.bytebuddy.pool.TypePool$Default$LazyTypeDescription$TokenizedGenericType.toErasure(TypePool.java:6241)
at reactor.blockhound.shaded.net.bytebuddy.pool.TypePool$Default$LazyTypeDescription$LazyTypeList.get(TypePool.java:6049)
at reactor.blockhound.shaded.net.bytebuddy.pool.TypePool$Default$LazyTypeDescription$LazyTypeList.get(TypePool.java:6022)
at java.base/java.util.AbstractList$Itr.next(AbstractList.java:371)
Steps to Reproduce
public class SampleReactor {
public static void main(String[] args) {
BlockHound.install();
}
}
Your Environment
Windows 10 Pro
JDK 11.0.2
Reactor 3.3.0
BlockHound 1.0.1
Spring Boot 2.2.1
If I use JDK 1.8.0.191 or remove reactor-tools dependency the exception still appears.
Hi @sergey-morenets,
I just tried to run Spring Boot 2.2.1 with BlockHound 1.0.1 on JDK 11 and it did not fail.
Could you please provide a reproducer maybe?
Hi @bsideup
Yes, I will try to narrow down this issue and provide a project to reproduce it.
Hi @bsideup
I created a project to reproduce this issue: https://github.com/sergey-morenets/blockhound
If I run SampleReactor or SampleWebFlux in IDE (for example, Intellij Idea 2019.2) I get this exception.
@sergey-morenets
Thanks! I confirm the bug. I need to check whether the bug comes from ByteBuddy or not. Meanwhile, please add this dependency as a workaround:
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.29</version>
</dependency>
Looks like a bug in ByteBuddy, reported:
raphw/byte-buddy#780
@sergey-morenets do you also see that the blocking calls are not reported or it is just the annoying error log statement?
I did some testing and it seems that, despite the error message, the instrumentation works fine and the calls are reported as usual.
Hi @bsideup
Since my application terminated because of exception I didn't check whether actual instrumentation worked as expected.
closing this since the associated ByteBuddy issue has been resolved on top of original workaround