I’m working with scala Play application. Aerospike is used as a storage for high load system. I’ve written the code that save and load plenty of data in LDT (LargeList). When running tests everything works just fine. When to call the same methods from the application (from Play Action, which process user request or from Play’s Global object), then I recive Error Code -1: java.lang.ClassNotFoundException: models.Aero.FileEntry, where the last is my model’s case class.
What is the reason of such strange behaviour? How can I fix it?
Exception arises when calling llist.scan or llist.find. The same code in tests - everything ok.
Exectly what I think! Something wrong with the class loading with Play. As I wrote during tests everything work as it should. It would be very useful to know the reason of this strange behaviour and to know how to make it work.
At a moment I have to change the model to avoid Java (scala) objects serialization. This is inconvenient though…
As the name suggests classNotFoundException in Java occurs when JVM (Java Virtual Machine) tries to load a particular class and doesn’t found the requested class in the classpath you specified. This means that, your classpath is broken (which is a very common problem in the Java world ). This problem can be particularly confusing for Java beginners. ClassNotFoundException is a checked exception , so it has to be catch or thrown to the caller.