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