Phase II trial to study the effectiveness of imatinib mesylate in treating patients who have persistent or recurrent ovarian epithelial or primary peritoneal cancer. Imatinib mesylate may stop the growth of tumor cells by blocking the enzymes necessary for tumor cell growth