First of all, there's no reason to ever take the battery out, even while on AC. Why are you doing that? Second, you should try a different power outlet. Apple AC adaptors will shut off, like a fuse, and require unplugging and replugging to reset. This means that the AC outlet you are using may be funky, causing your adaptor to constantly shut off. Try plugging in somewhere else to see if you keep having the problem.
Steve