Hi!
I'm trying to create a schedule service at jboss 4.2.1 but I'm not sure what to do.
I need a service to be started by the application server that runs every half an hour.
I wrote a class but the problem is when I start jboss, I have the following error message:
10:11:11,280 ERROR [TimerServiceImpl] Cannot create txtimer
java.lang.IllegalStateException: Unable to persist timer
Caused by: java.sql.SQLException: Unique constraint violation: in statement [insert into TIMERS (TIMERID,TARGETID,INITIALDATE,TIMERINTERVAL,INSTANCEPK,INFO) values (?,?,?,?,?,?)]
@Service @Management(AtividadeTimerServiceManagement.class) public class AtividadeTimerServiceBean implements AtividadeTimerServiceLocal, AtividadeTimerServiceManagement { @Resource private TimerService timerService; public void create() throws Exception { this.timerService.createTimer(15*60*1000, 5*60*1000, null); } public void destroy() { } public void start() throws Exception { } public void stop() { } @Timeout public void monitorPeriodoCadastral(Timer timer) { log.info("monitorPeriodoCadastral..."); } }
could you please also post the table definition for the TIMERS table.