This paper derives a closed-form expression for the default probability and the default correlation of firms under a structural model of credit risk. Specifically, the underlying firms are assumed to have the value process driven by a Hawkes jump-diffusion model with the continuous parts of the trajectories being driven by correlated Brownian motions, while the jumps being driven by Hawkes processes having general structure of the exciting functions. The proposed framework takes into account the numerically observed facts about the default, i.e., clustering and unexpectedness. Furthermore, the default barriers are assumed to be stochastic in nature and modeled as stochastic processes, affected by common factors reflecting the systematic risk. A sensitivity analysis of default probability and correlation is conducted to investigate the impact of jump risk, clustering, and stochastic default barriers. These numerical studies demonstrate that jump clustering increases the default probability but reduces the correlation of defaults.