public void testCancelPeriodicTasksTwice() throws Exception {
txnScheduler.runTask(
new TestAbstractKernelRunnable() {
public void run() {
// test the basic cancel operation, within a transaction
PeriodicTaskHandle handle =
taskService.schedulePeriodicTask(
new ManagedTask(), 100L, 100L);
handle.cancel();
try {
handle.cancel();
fail("Expected ObjectNotFoundException");
} catch (ObjectNotFoundException e) {
System.err.println(e);
}