Monday, February 07, 2011

Null Exception when Generating Classes using SpecificCompiler.compileSchema(File, File)

I decided to try generating classes corresponding to an Avro schema I had created using SpecificCompiler.compileSchema(src, dest). It threw an exception "null" and I found that what it wants to do is create a File(parent, child) using the destination path as the parent and the namespace as the child. The problem was that my schema lacked a namespace and when child is null instantiating a File, it will throw a null exception.

12 comments: