Hacker News new | past | comments | ask | show | jobs | submit login

NoClassDefFoundError? But it’s right there!

Although in this case the cause was very different, it reminds me of an old "trap for young players" with loading shared libraries dynamically --- the library itself can exist and be readable and executable, and yet attempting to load it fails with a "file not found" error. This happens when one of its dependencies, directly or indirectly, is missing.




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 hosted in OS X, with shared folders for the code, and by default OS X volumes are not case sensitive. Meanwhile the linux staging and production environments were using actual linux filesystems, which were case sensitive. So someone added a new class MyFancyClass, then tried to import it as MyFancyclass, and it worked great in dev since the underlying FS of the host OS could find the file, then failed on staging.

A fun debugging ride, and a good reminder that 1) having dev and staging the same is really important and 2) that might be harder than you think. :)


> 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!


I recall, back in the mid-to-late 2000s, investigating OutOfMemoryError on a Windows server, to find that the cause was an inability to create a thread, because the kernel buffer space for managing threads was exhausted ( many thousands of threads created )

https://dzone.com/articles/outofmemoryerror-unable-create


I've had this one a few times recently, and every time, it stumps for for a few minutes!

Yes, I know the details, no I never remember them when it happens to me ;)


Ah! This was one of my very, very least favorite things about developing win32 DLLs, way back in the day.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: