Using stimulant based thermogenics with a stomach ulcer is not smart. Caffeine is well known to make the symptoms of stomach ulcers worse.
The best appetite suppressant you can use that won't effect your ulcer is fiber. Base your diet around low calorie high volume foods like broccoli, celery, mushrooms etc. You can eat them to pretty much your hearts content and they will add very minimal calories to your diet.