New bug with scala code : ClassNotFoundException


#1

My scala code randomly fails to run in the Ultimate Tic Tac Toe.

I can test the code in the online IDE, submit it, win some games (seen in Last Battles) where I actually play a few moves and then all of my games crash with this Exception. And the code which worked now also fails in the IDE.

Note that I’m using packages (my code is merged from several sources in one file with https://github.com/huiwang/codingame-scala-kit/).

This seems similar to the bug reported here : https://www.codingame.com/forum/t/xmash-rush-bugs/72291/12

Screenshot where my code worked
image

full stack :

java.lang.ClassNotFoundException: com.tyrcho.tictactoe.UltimateTicTacToeState
at java.net.URLClassLoader.findClass on line 381
at java.lang.ClassLoader.loadClass on line 424
at java.lang.ClassLoader.loadClass on line 357
at Player$.<init> on line 6
at Player$.<clinit> on line 0
at Bridge$.delayedEndpoint$Bridge$1 on line 6
at Bridge$delayedInit$body.apply on line 1
at scala.Function0.apply$mcV$sp on line 34
at scala.Function0.apply$mcV$sp$ on line 34
at scala.runtime.AbstractFunction0.apply$mcV$sp on line 12
at scala.App.$anonfun$main$1$adapted on line 76
at scala.collection.immutable.List.foreach on line 389
at scala.App.main on line 76
at scala.App.main$ on line 74
at Bridge$.main on line 1
at Bridge.main on line 0
at sun.reflect.NativeMethodAccessorImpl.invoke0 on line 0
at sun.reflect.NativeMethodAccessorImpl.invoke on line 62
at sun.reflect.DelegatingMethodAccessorImpl.invoke on line 43
at java.lang.reflect.Method.invoke on line 498
at scala.reflect.internal.util.ScalaClassLoader.$anonfun$run$2 on line 99
at scala.reflect.internal.util.ScalaClassLoader.asContext on line 34
at scala.reflect.internal.util.ScalaClassLoader.asContext$ on line 30
at scala.reflect.internal.util.ScalaClassLoader$URLClassLoader.asContext on line 125
at scala.reflect.internal.util.ScalaClassLoader.run on line 99
at scala.reflect.internal.util.ScalaClassLoader.run$ on line 91
at scala.reflect.internal.util.ScalaClassLoader$URLClassLoader.run on line 125
at scala.tools.nsc.CommonRunner.run on line 22
at scala.tools.nsc.CommonRunner.run$ on line 21
at scala.tools.nsc.ObjectRunner$.run on line 39
at scala.tools.nsc.CommonRunner.runAndCatch on line 29
at scala.tools.nsc.CommonRunner.runAndCatch$ on line 28
at scala.tools.nsc.ObjectRunner$.runAndCatch on line 39
at scala.tools.nsc.MainGenericRunner.runTarget$1 on line 66
at scala.tools.nsc.MainGenericRunner.run$1 on line 85
at scala.tools.nsc.MainGenericRunner.process on line 96
at scala.tools.nsc.MainGenericRunner$.main on line 101
at scala.tools.nsc.MainGenericRunner.main on line 0

#2

We investigated quickly and found that it is due to our cache of compilation. (Before we used to recompile every time the code during a submit). Now, all the classes in your imported folder can’t be found.

Unfortunately, there is no easy fix for now, so I’d suggest not using TrueLaurel Scala kit. I’m sorry.


#3

Ouch :frowning: that would be a very big issue for challenges and difficult games. I would not continue competition here without the ability to define packages and classes for non trivial games.

I don’t fully understand the root cause for this issue : what is cached after compilation ? all .class files ? but not in subfolders ?


#4

We already did a fix (bit hacky) to allow “com” packages so it should solve your issue


#5

I’ve resubmitted and I can confirm that now it works. Thanks for the quick hacky fix :slight_smile: