twitter/scalding — pull request #965 by matt-martin (2014-07-18 03:28:56+00:00)
Title: Add more descriptive error message if creation of test (i.e. in memory) tap fails

Had a classpath related issue while trying to setup a project using scalding and got a nondescript error message:

java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at com.twitter.scalding.Job$.apply(Job.scala:47)
at com.twitter.scalding.JobTest$$anonfun$apply$1.apply(JobTest.scala:30)
at com.twitter.scalding.JobTest$$anonfun$apply$1.apply(JobTest.scala:30)
at com.twitter.scalding.JobTest.initJob(JobTest.scala:186)
at com.twitter.scalding.JobTest.run(JobTest.scala:145)
at com.test.NumberJoinTest$$anonfun$9$$anonfun$apply$1.apply$mcZ$sp(BasicTest.scala:48)
Caused by: java.lang.RuntimeException: Failed to create a tap for: FixedPathTypedDelimited(List(input0),0:1,false,false,	,scala.Tuple2[Int, Int])
at com.twitter.scalding.FileSource$$anonfun$createTap$4.apply(FileSource.scala:166)
at com.twitter.scalding.FileSource$$anonfun$createTap$4.apply(FileSource.scala:166)
at com.twitter.scalding.FileSource.createTap(FileSource.scala:166)
at com.twitter.scalding.Source.read(Source.scala:99)
at com.test.NumberJoinerJob.(BasicTest.scala:27)
... 9 more

When I stepped through in the debugger, I discovered the root cause was a bad classpath:

java.lang.ClassNotFoundException: com.twitter.maple.tap.MemorySourceTap

I've put this change together in the hope that it might make it easier for folks to immediately diagnose this sort of (admittedly avoidable) failure.