Spark job throws ClassNotFoundException for custom class when KryoSerializer enabled
Goal: Ensure that a user‑defined class used in a Spark transformation is serializable when the application runs on a cluster with spark.serializer set to KryoSerializer. In local mode the job completes because Spark falls back to the JVM’s default Java serializer for driver‑side objects, masking the missing Kryo registration. When submitted to a cluster the