Reply
Highlighted
New Contributor
Posts: 1
Registered: ‎12-04-2015

spark2-submit to execute java email class throwing "java.lang.ClassNotFoundException: javax.mail.Add

Greetings,

 

We upgrade Spark2 from 2.1 to 2.2 on Cloudera Hadoop 5.12.1

We have a job executing a java email class via spark2-submit

Everything worked fine on Spark2.1. Afer upgrading to Spark2.2, we are getting below error. Please note that same works good using spark-submit.

 

 

$ spark2-submit --class Email MyEmail.jar --conf "spark.executor.extraJavaOptions=-verbose:class"
java.lang.NoClassDefFoundError: javax/mail/Address
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:348)
        at org.apache.spark.util.Utils$.classForName(Utils.scala:230)
        at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:712)
        at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:180)
        at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:205)
        at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:119)
        at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
Caused by: java.lang.ClassNotFoundException: javax.mail.Address
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 8 more

 

 

$ spark-submit --class Email MyEmail.jar --conf "spark.executor.extraJavaOptions=-verbose:class"
>>>>>>>>>>>>[javax.mail.Provider[TRANSPORT,aws,com.amazonaws.services.simpleemail.AWSJavaMailTransport,Amazon Web Services LLC], javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc], javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc], javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc]]
Email has been sent!!!

 

 

 

Thanks,

Sudheer

 

 

 

 

 

 

 

 

Announcements