EsotericSoftware / kryo

Java binary serialization and cloning: fast, efficient, automatic
BSD 3-Clause "New" or "Revised" License
6.19k stars 823 forks source link

java.lang.NoClassDefFoundError: com/esotericsoftware/minlog/Log #869

Closed Daanielvb closed 2 years ago

Daanielvb commented 2 years ago

Describe the bug I am a Spring state machine user and started experiencing this kryo issue yesterday out of the blue.

To Reproduce Acquiring a simple state machine instance is thrown at us the following stack trace

Caused by: java.lang.NoClassDefFoundError: com/esotericsoftware/minlog/Log
    at com.esotericsoftware.kryo.serializers.FieldSerializerConfig.<init>(FieldSerializerConfig.java:47)
    at com.esotericsoftware.kryo.Kryo.<init>(Kryo.java:154)
    at com.esotericsoftware.kryo.Kryo.<init>(Kryo.java:161)
    at org.springframework.statemachine.kryo.AbstractKryoStateMachineSerialisationService$1.create(AbstractKryoStateMachineSerialisationService.java:52)
    at com.esotericsoftware.kryo.pool.KryoPoolQueueImpl.borrow(KryoPoolQueueImpl.java:48)
    at com.esotericsoftware.kryo.pool.KryoPoolQueueImpl.run(KryoPoolQueueImpl.java:56)
    at org.springframework.statemachine.kryo.AbstractKryoStateMachineSerialisationService.encode(AbstractKryoStateMachineSerialisationService.java:115)

Environment:

Additional context

This is my dependency tree, I see min log listed as one dependency of kryo 4.0.2

 org.springframework.statemachine:spring-statemachine-data-jpa -> 2.4.0
|    +--- org.springframework.statemachine:spring-statemachine-data-common:2.4.0
|    |    +--- org.springframework.statemachine:spring-statemachine-core:2.4.0 (*)
|    |    +--- org.springframework.statemachine:spring-statemachine-kryo:2.4.0
|    |    |    +--- org.springframework.statemachine:spring-statemachine-core:2.4.0 (*)
|    |    |    \--- com.esotericsoftware:kryo-shaded:4.0.2
|    |    |         +--- com.esotericsoftware:minlog:1.3.0
|    |    |         \--- org.objenesis:objenesis:2.5.1

Any help is really appreaciated

Daanielvb commented 2 years ago

It seemed to be a gradle/intellij caching issue. Clearing all the caches apparently resolved the problem