Closed jgabrielfreitas closed 4 years ago
I actually don't know what the problem in your project setup is. But somehow it seems that the Avro class is not available at runtime. If you still think this is a bug in avro4k, please supply a minimal project setup to reproduce the case.
@jgabrielfreitas can you supply a minimal project setup to reproduce your case? Otherwise, I will close this issue.
Hi @thake! First of all, thanks for your attention.
Well, I have a project running (perfectly) with:
kotlin 1.3.72
ktor 1.3.2
avro4k 0.30.0
serialization 0.20.0
kafka client 2.4.0
kafka avro serializer 5.3.0
And when kotlin 1.4.0 was realeased on stable channel, I upgraded my dependencies to:
kotlin 1.4.1
ktor 1.4.0
avro4k 0.40.0.12-SNAPSHOT
serialization 1.0-M1-1.4.0-rc
kotlinx serialization 1.4.10
kafka client 2.6.0
kafka avro serializer 5.3.0
And as I told before, I don't know exactly where is the error.
I'm having this NoClassDefFoundError
when I try deserialize an avro.
In debug mode, I see the message correctly, but this error occour when I try deserialize this message into a object.
So, my point is: I have been doing some research, between kotlinx.serialization and avro4k, but I still haven't fully understood the error. Can you help me?
And sorry about that. kotlinx.serialization is relatively new to me.
Thanks!
@jgabrielfreitas The problem with the link you have used in this issue is that I can't see any consistent build state that only uses kotlin 1.4. I just pulled your branch https://github.com/jgabrielfreitas/ktor-hexagonal-benchmark/tree/improvement/kotlin-1.4.1 and got the following classpath clashes:
/home/thake/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.4.0/kotlin-stdlib-jdk8-1.4.0.jar (version 1.4)
/home/thake/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.4.0/kotlin-stdlib-jdk7-1.4.0.jar (version 1.4)
/home/thake/.m2/repository/org/jetbrains/kotlin/kotlin-reflect/1.3.61/kotlin-reflect-1.3.61.jar (version 1.3)
/home/thake/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib/1.4.10/kotlin-stdlib-1.4.10.jar (version 1.4)
/home/thake/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib-common/1.4.10/kotlin-stdlib-common-1.4.10.jar (version 1.4)```
```w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
/home/thake/.m2/repository/org/jetbrains/kotlin/kotlin-reflect/1.3.61/kotlin-reflect-1.3.61.jar (version 1.3)
/home/thake/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.61/kotlin-stdlib-jdk8-1.3.61.jar (version 1.3)
/home/thake/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.3.61/kotlin-stdlib-jdk7-1.3.61.jar (version 1.3)
/home/thake/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.4.0/63e75298e93d4ae0b299bb869cf0c627196f8843/kotlin-stdlib-1.4.0.jar (version 1.4)
/home/thake/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib-common/1.4.0/kotlin-stdlib-common-1.4.0.jar (version 1.4)
As you're building a shadow jar, this can lead to problems. It seems like this can be the cause for your problems migrating to kotlin 1.4.
We both can't be sure if the cause of the issue you are seeing is this library or your integration. Therefore I wanted to have a minimal project setup that can be used to reproduce the issue. Your project setup seems to have other problems related to the migration to kotlin 1.4.10 which I can't debug, because I don't have the time on my hands for that. So if you want some help from us, please provide us with an easy entry that shows that the cause of the issue is within this library. After all this is an open source project without any organisation backing it commercially.
@thake ,I'm sorry. Since the issue was opened, I haven't had time to dedicate myself to this project. I think I will be able to set aside time in the next few days. I will create a new project, with the same dependencies and a kafka producer with a complete example.
the best thing to do for now is to close the issue. by the way, I'll be back to give you a feedback about it.
thank for your attention!
Hi @sksamuel , today I'm trying to upgrade my project kotlin version to 1.4 and avro4k is getting a error on intialization.
I have been doing some research, between kotlinx.serialization and avro4k, but I still haven't fully understood the error. Can you help me?
Basically when the Avro class will by initialized, a crash happens:
and the following error
I've tried create Avro class without the
Avro.default
(for debug) because its getting the same error.my dependencies versions
I honestly don't know exactly where else to look to understand the error. Can you give me a hand? There's anything that I can do to help?
It's working normally in version 1.3.72 of the kotlin and thanks for working with the library
The project implementation here.
Thanks!