Has anyone ever experienced an error like this whi...
# arrow-contributors
j
Has anyone ever experienced an error like this while using arrow?
Could not initialize class arrow.core.Either$Left
This is in a rather complex bit of code so I have no clue how to reproduce it in simple terms. The function that fails also works if called from a different method, but fails with others.
The code that causes it can be run by checking out this commit from `arrow-check`https://github.com/arrow-kt/arrow-check/pull/35/commits/b5bdc4219f4746fc9081e1a79ec4a56f3b86ec80 and running the tests.
r
I’ve seen something similar related to not being able to init classes when my local cache had local arrow artifacts I built
so, some kind of conflict in the classloader picking up the wrong classes
I suppose you don’t have kotest in the classpath otherwise their version of Arrow it depends on may be conflicting somehow
j
I do, this runs through kotests test runner, that might be the reason. The weird part is that other code using Either in the same build works just fine. Also this happens in the
AndThen
loop at quite deep stackdepth so that may also be problematic, although it probably should not
s
I've seen this couple times before.. 🤔 Can't remember what caused it or I solved it..
You don't have different versions of Arrow on the classpath? Is this happening inside
SAndThen
? Or regular
AndThen
? Is it inside any nested functions?
Is this on the arrow-check PR? Could you point me to the file?
j
Its inside normal
AndThen
Is this on the arrow-check PR? Could you point me to the file?
Yes one sec, though its hard to understand how it all works together 😅
I tried the suspend andthen but that failed because of reasons, I actually have to do
runBlocking
for function generation because there is just no way to use suspend there 😕
Only for function generation tho, everything else still uses
AndThenS
I also got another failure, same error but with a kotlinx class, when I use
ListToFunction(Unit.toFunction())
instead of
Long.toFunction
My current guess is 50/50 between what raul suggested with kotest deps doing me wrong here and this error hiding a stackoverflow because its deep inside an
AndThen
stack
1
So yeah, the latest commit of my pr gets this failure if you run the tests
s
You excluded Arrow from Kotest dependencies so that's probably not causing any conflicts on the classpath
have you checked
./gradlew dependencies
if you have different versions on the classpath for that module?
j
If I generate an either before generating a function it succeeds 1-3 times (not consistent) but then just hangs. But it does not fail, something is very very odd here...
It hanging somewhere is actually fine since the whole implementation is just a bit weird and may have these bugs, but it does not explain why it throws the classdefnotfound errors
Now when generating an either first I am getting
Caused by: java.lang.NoClassDefFoundError: Could not initialize class kotlinx.coroutines.CompletedExceptionally
This is so weird, the whole logic behind generating function is a bit whack mostly because of stacksafety but still this is just weird. The callstack here is also much smaller
gradlew dependencies
gives me
java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7
lol. I am getting more and more confused by the minute
Can you reproduce the error @simon.vergauwen? I am beginning to think this may be something else 😕
s
gradlew dependencies
 gives me 
java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7
 lol. I am getting more and more confused by the minute
mind blown
I haven't had time to try and reproduce yet
j
Damn this is a good emote mind blown mind blown mind blown
I haven't had time to try and reproduce yet
Ok, no worries^^ I put of this for a while, I am stuck either way, even if it can't be reproduced so 😅
r
java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7 <- you running with the wrong jdk or compiling with a different jdk
This is what I get unless I use jdk8 on the arrow build in case it helps
j
You know my impression of the jvm gets worse and worse every day I use it. I'll try using a different jdk/jvm combo. Not even sure what I have atm.
😱 1
Yeah I am on jdk14/jvm14, trying with jdk8/jvm8 now...
Seems to work, now it stackoverflows, but given that the whole thing is very prone to stackoverflows that is a step up. Thank you so much @raulraja although I still really dislike that a newer jvm/jdk just fails that way, its so confusing 😅
now it stackoverflows, but given that the whole thing is very prone to stackoverflows that is a step up
That luckily only refers to Generators generating functions, but since I had this fixed prior to moving away from mtl+IO there must be a way to fix this 😄
👏 2