title: ClassNotFound when submit a Spring-boot-fat-jar to spark
body: <p>when I build a fat jar using spring-boot, its name is 
  <strong>sparker4m-0.0.1.jar</strong></p>
  
  <p>And I "spark-submit" it to spark cluster.</p>
  
  <p><code>./bin/spark-submit --deploy-mode client --class org.springframework.boot.loader.JarLauncher ~/Desktop/sparker4m-0.0.1.jar --spark.master=spark://172.16.179.52:7077 --source_path=file:///usr/local/spark-2.3.1-bin-hadoop2.7/hdfs_mock/1530842877616 --out_path=file:///usr/local/spark-2.3.1-bin-hadoop2.7/hdfs_mock/153084287761_out --hadoop.home.dir=/usr/local/hadoop</code></p>
  
  <p>You can see I use " --class org.springframework.boot.loader.JarLauncher", because it's the main-class of Spring-boot-jar, and the actual Main-class is test.sparker4m.Sparker4mApplication</p>
  
  <p>here is my code:</p>
  
  <pre><code>@SpringBootApplication
  public class Sparker4mApplication {
      public static void main(String[] args) throws Exception{
         ApplicationContext ctx = 
         SpringApplication.run(Sparker4mApplication.class, args);
  
         SparkConf conf = new SparkConf().setAppName("Test")
                      .setMaster(happyDay.getVal("spark.master"))
                      .set("spark.driver.host", Inet4Address.getLocalHost().getHostAddress());
         JavaSparkContext sc = new JavaSparkContext(conf);
  
         .........
  
  
         JavaPairRDD&lt;String, String&gt; transformed = rdd.mapToPair(new PairFunction&lt;Tuple2&lt;String, PortableDataStream&gt;, String, String&gt;() {
              @Override
              public Tuple2&lt;String, String&gt; call(Tuple2&lt;String, PortableDataStream&gt; tuple2) throws Exception {
                  String fname = tuple2._1();
                  PortableDataStream content = tuple2._2();
                  byte[] bytes = content.toArray();
                  String result = YUVSimpleTrans.transform(bytes);
                  return new Tuple2&lt;&gt;(fname, result);
              }
          });
  
          ..........
  
          .........
      }
  }
  </code></pre>
  
  <p>Everything goes well, but, when <strong>Excecutor</strong> runs, exception throws:</p>
  
  <pre><code>Caused by: java.lang.ClassNotFoundException: test.sparker4m.Sparker4mApplication$1
  at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
  </code></pre>
  
  <p>test.sparker4m.Sparker4mApplication$1 is an inner class used by test.sparker4m.Sparker4mApplication and it should be "new PairFunction&lt;Tuple2&lt;String, PortableDataStream&gt;, String, String&gt;()".</p>
  
  <p>I supposed that, spark's Executor process use a individual URLClassLoader to load classes, but my(sprint-boot-fat-jar's) classes are all in <strong>sparker4m-0.0.1.jar/BOOT-INF/classes</strong>, and my dependency jars are all in <strong>sparker4m-0.0.1.jar/BOOT-INF/lib</strong>, so the URLClassLoader cannot load the class.</p>
  
  <p>Is there any good idea for this?  needs help!</p>