manuzhang commented on issue #23903: [SPARK-26977][CORE] Fix warn against 
subclassing scala.App
URL: https://github.com/apache/spark/pull/23903#issuecomment-468100299
 
 
   > I find that the current check works if you check whether "MyApp$" extends 
`scala.App`
   
   Could you please provide a `spark-submit` example ?
   
   Both `spark-submit --class MyApp` (for `class MyApp extends scala.App`) and 
`spark-submit --class MyApp$` (for `object MyApp extends scala.App`) will fail 
with 
   
   ```
   Exception in thread "main" java.lang.IllegalStateException: The main method 
in the given main class must be static
           at 
org.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:44)
           at 
org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:894)
           at 
org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:198)
           at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:228)
           at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:137)
           at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to