Thread.currentThread.getContextClassLoader returns a stub of a classloader:
res15: java.lang.ClassLoader = sun.misc.Launcher$AppClassLoader@53004901
This resulting classloader is unable to load resources from the system classpath, so any code you call from within the console may fail. For example, the Hadoop project uses the context class loader to obtain configuration files from the jars. But it will fail to find config entries (bad):
scala> val c = new Configuration
c: org.apache.hadoop.conf.Configuration = Configuration: core-default.xml, core-site.xml
res12: Int = 0
One cannot set the Thread.currentThread.setContextClassLoader because every new line is a new thread. Thus perhaps one could fix it by doing a block first setting the context class loader, then calling the code which needs it like such.
Essentially the result is legitimate code which will run in a script/app in scala will not run in a console.