When you say it “doesn’t work”, do you get an error message, other unexpected behavior, or what? If it’s an error message, include the complete text of the error.
Note that applications should define a main() method instead of extending scala.App . Subclasses of scala.App may not work correctly.
Now, why that is the case? I would guess that the weird compile-time black magic of DelayedInit doesn’t play well with the weird runtime back magic of Spark reflection.