[DROOLS-253] explicitly use java.lang.Exception in templates generating java classes
(cherry picked from commit 2fe546dbd99d69a1028349a062428fa51297fe2f)