Github user pwendell commented on the pull request:
https://github.com/apache/spark/pull/322#issuecomment-39699792
Ah I see, @ueshin you are right. It's the bootstrap class loader and it
won't have any spark definitions. I was mixing this up with the system class
loader.
```
./bin/spark-shell
scala> Class.forName("org.apache.spark.serializer.JavaSerializer")
res7: Class[_] = class org.apache.spark.serializer.JavaSerializer
scala> Class.forName("org.apache.spark.serializer.JavaSerializer", true,
null)
java.lang.ClassNotFoundException: org/apache/spark/serializer/JavaSerializer
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:270)
at $iwC$$iwC$$iwC$$iwC.<init>(<console>:11)
at $iwC$$iwC$$iwC.<init>(<console>:16)
at $iwC$$iwC.<init>(<console>:18)
at $iwC.<init>(<console>:20)
```
We should definitely clean this up. The behavior we want in every case is
to either use the context class loader (if present) and if not use the
classloader that loads spark classes (e.g. the system classloader).
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---