Live data from Hacker News

How We Found a Missing Scala Class

heapanalytics.com

41–45 of 45 posts

Re: How We Found a Missing Scala Class

#41
post #40
post #25

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?

It says right there in the article.

Re: How We Found a Missing Scala Class

#42
post #31
post #19

Earlier 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.

Oh yes, that too!

Re: How We Found a Missing Scala Class

#43

The 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…

I was thinking of doing this. We have a Scala app that we deploy as a fat jar in a docker container. But if we instead shipped the individual files, the diffs between docker builds would be much smaller. Still, the time to build and deploy the docker container is so small it hasn't been worth the effort yet.

Re: How We Found a Missing Scala Class

#44

It 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…

Scala is not exactly a new trendy technology at this point; it's being used in industry quite widely.

Re: How We Found a Missing Scala Class

#45
post #34

Earlier 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.

Scala 2.12 lambdas compile to Java 8 lambdas.
Post reply on HN