[KARAF-3335]make endorsed java.lang.Exception compatible with JDK7
(cherry picked from commit c54c1542cb1f54635d0b17d366233ad468bed2a5)