The goal of a phase Ib clinical trial is to find the doses of drugs that are safe. Although BGJ398 has been given to patients safely on its own, it has never been given together with imatinib mesylate. In this study, we will test the safety of taking BGJ398 with imatinib mesylate. The investigators will learn this by closely checking for side effects that the patient may experience. Side effects can be seen in laboratory studies, on physical examination, or by asking the patient.Once a dose has been determined to be safe, a larger Phase II study will be done in patients with advanced GIST who have never received any prior treatments.