Intermittent exceptions when using a subclass of JavaExec to invoke the Saxon XSLT processor

I encountered the same issue and I was able to solve it by calling

setMain(“com.icl.saxon.StyleSheet”)

instead of doing

main = “com.icl.saxon.StyleSheet”