POI 4 XPages – document generation works only once

Oliver, add the client-side JS call XSP.allowSubmit() to your button in order to allow new submits after pressing the button: <xp:button id=”button5″ styleClass=”btn btn-sm printbutton” style=”display:none”> <i class=”fa fa-print”></i> &#160; <xp:text> <xp:this.value><![CDATA[#{javascript:”Nach MS Word exportieren”}]]></xp:this.value> </xp:text> <xp:eventHandler event=”onclick” submit=”true” refreshMode=”complete”> <xp:this.action> <xp:actionGroup> <xp_1:generateDocument documentId=”wordprint” loaded=”true”> </xp_1:generateDocument> </xp:actionGroup> </xp:this.action> <xp:this.script><![CDATA[XSP.allowSubmit()]]></xp:this.script> </xp:eventHandler> </xp:button>

Meaning of java.lang.ClassCastException: someClass incompatible with someClass

Philippe Riand explaned this by email: This class cast happens because the same class had been loaded twice by 2 different class loaders. Thus, from a Java standpoint, they are different and the cast fails. Now, each XPages application is having its own classloader. But this class loader is discarded each time a design change … Read more