OK, I narrowed down the problem. The XSPGenerator object is not re-created when the page is requested the second time. So, the XSPModuleHelper isn't re-initialized. Because its input modules were released at the end of the previous generate() execution, the inputModules map is null and the exception is thrown.
BTW, as a workaround you can add
<xsp:logic>
_xsp_module_helper = null;
</xsp:logic>at the bottom of your logicsheet. This way, the module helper is initialized the second time generate() is called.
-- Andreas
