One possible solution is to spark-submit with --driver-class-path and list all recursive dependencies. This is fragile and error prone.
Non-working alternatives (used in SparkSubmit.scala AFTER arguments parser is initialized): spark-submit --packages ... spark-submit --jars ... spark-defaults.conf (spark.driver.extraJavaOptions, spark.jars, spark.driver.extraClassPath, ...) On Fri, Aug 7, 2015 at 8:57 AM, mlemay [via Apache Spark User List] < ml-node+s1001560n24169...@n3.nabble.com> wrote: > That starts to smell... > > When analyzing SparkSubmit.scala, we can see than one of the firsts thing > it does is to parse arguments. This uses Utils object and triggers > initialization of member variables. One such variable is > ShutdownHookManager (which didn't exists in spark 1.3) with the later log4j > initialization. > > setContextClassLoader is set only a few steps after argument parsing in > submit > doRunMain > runMain.. > > That pretty much sums it up: > spark.util.Utils has a new static dependency on log4j that triggers it's > initialization before the call to > setContextClassLoader(MutableURLClassLoader) > > Anyone has a workaround to make this work in 1.4.1? > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://apache-spark-user-list.1001560.n3.nabble.com/log4j-custom-appender-ClassNotFoundException-with-spark-1-4-1-tp24159p24169.html > To unsubscribe from log4j custom appender ClassNotFoundException with > spark 1.4.1, click here > <http://apache-spark-user-list.1001560.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=24159&code=bWxlbWF5QGdtYWlsLmNvbXwyNDE1OXwtMTk2MTgzMjQzNg==> > . > NAML > <http://apache-spark-user-list.1001560.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > -- View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/log4j-custom-appender-ClassNotFoundException-with-spark-1-4-1-tp24159p24170.html Sent from the Apache Spark User List mailing list archive at Nabble.com.