The invention relates to JNK inhibitors and corresponding methods, formulations, and compositions for inhibiting JNK and treating JNK-mediated disorders. The application discloses JNK inhibitors, as described below in Formula I: wherein p, q, Y', r, R1, R2, X, X1, X2, X3, and X4 are as defined herein. The compounds and compositions disclosed herein are useful to modulate the activity of JNK and treat diseases associated with JNK activity. Disclosed are methods and formulations for inhibiting JNK and treating JNK-mediated disorders, and the like, with the compounds, and processes for making said compounds, and corresponding compositions, disclosed herein.