Earlier quoted context omitted.
The title is misleading. The class was there all along, the NoClassDefFoundError was thrown because the class loader was closed when trying to load a class.
But why can you even do that?
How We Found a Missing Scala Class
41–45 of 45 posts
Re: How We Found a Missing Scala Class
#42Earlier quoted context omitted.
I ran across another similar-yet-very-different example of this once in a completely different language. In my case, we added a new class, it worked fine on dev, then failed on staging (and would have failed in production if we'd let it go that far). This was confusing, because we were using Vagrant to ensure our dev and staging environments were identical. What could be going on? Well, our linux VMs were being hoste…
> a good reminder that 1) having dev and staging the same is really important Actually, I think it proves that having staging and PROD the same is particularly important.
Re: How We Found a Missing Scala Class
#43The moment the article mentioned "Fat jar" I knew that'd be the problem. I don't recommend using any type of fat jar plugin (like OneJar) or even Google Guice for that matter. Custom class loaders are a nightmare. Thanks to Docker containers, you should never really need a far jar again. Just find a decent Docker packager for your build system (sbt, gradle, etc.) and it can plop all your dependencies in there in a ni…
Re: How We Found a Missing Scala Class
#44It sounds like you have a lot of operation issues due to the technologies that you used. I mean, at least you aren't doing your backend in node, but running an actor system on top of an actor system is going to be brutal to properly analyze once you actually have scale. What sort of process do you have for picking trendy technologies vs tested ones, and how much do you talk to people who have built large scale system…
Re: How We Found a Missing Scala Class
#45Earlier quoted context omitted.
What is problematic about Fat jars? The problem seemed to be Flink's implementation to unload the FatJar's classloader when erroring. This would have happened with slim jars as well, wouldnt it? I also dont see how docker relates exactly, you can have hundreds of library jars in a classpath with standard classloaders, no docker required
Also Scala's lambdas create new anonymous classes, but Java's lambdas are kind of bootstrapped static methods in the existing class file. It does get converted to a class at runtime, but then it's long past the classloader anyway.