add application global setting, and fix the getCause of the exception trapping