loading custom generator with external resource but fails to save the inputstream