Start Timer NullPointerException - Possible Bug

Hello Everyone again,

We have created a process which is started by a Start Timer every 5 minutes. The process uses a DAO object to find new records. If no records are found, the process ends. If not, a case goes on.

This works perfectly in Studio. The first time we deployed the process to a Bonita Server Bundle (Tomcat), the process worked ok. Then we made some adjustments, deleted the process and deployed it again (always in version 1.00).

Here funny things start happening. When we finished the Actor mappings and enabled the process, the server complained it already had a 1.00 version. We deleted the version just deployed, and deployed it again, this time with no complaints.

But every time we disable/enable the process, we get the following errors.

Catalina.out:

2017-07-12 00:45:00.811 +0000 INFO: org.quartz.ee.jta.JTAJobRunShell Job 1.Timer_Ev_8325391728827622526Iniciar Chequeo threw a JobExecutionException: 
org.quartz.JobExecutionException: org.bonitasoft.engine.scheduler.exception.SJobExecutionException: java.lang.NullPointerException [See nested exception: org.bonitasoft.engine.scheduler.exception.SJobExecutionException: java.lang.NullPointerException]
	at org.bonitasoft.engine.scheduler.impl.AbstractQuartzJob.execute(AbstractQuartzJob.java:39)
	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
Caused by: org.bonitasoft.engine.scheduler.exception.SJobExecutionException: java.lang.NullPointerException
	at org.bonitasoft.engine.scheduler.impl.JobWrapper.execute(JobWrapper.java:120)
	at org.bonitasoft.engine.scheduler.impl.AbstractQuartzJob.execute(AbstractQuartzJob.java:36)
	... 2 more
Caused by: java.lang.NullPointerException
	at org.bonitasoft.engine.business.data.proxy.ServerProxyfier.unProxy(ServerProxyfier.java:187)
	at org.bonitasoft.engine.execution.ProcessExecutorImpl.saveBusinessData(ProcessExecutorImpl.java:465)
	at org.bonitasoft.engine.execution.ProcessExecutorImpl.initializeSingleBusinessData(ProcessExecutorImpl.java:447)
	at org.bonitasoft.engine.execution.ProcessExecutorImpl.initializeBusinessData(ProcessExecutorImpl.java:433)
	at org.bonitasoft.engine.execution.ProcessExecutorImpl.initialize(ProcessExecutorImpl.java:385)
	at org.bonitasoft.engine.execution.ProcessExecutorImpl.start(ProcessExecutorImpl.java:822)
	at org.bonitasoft.engine.execution.ProcessExecutorImpl.start(ProcessExecutorImpl.java:792)
	at org.bonitasoft.engine.execution.event.EventsHandler.instantiateProcess(EventsHandler.java:419)
	at org.bonitasoft.engine.execution.event.EventsHandler.triggerCatchEvent(EventsHandler.java:348)
	at org.bonitasoft.engine.execution.event.EventsHandler.access$000(EventsHandler.java:91)
	at org.bonitasoft.engine.execution.event.EventsHandler$1.execute(EventsHandler.java:324)
	at org.bonitasoft.engine.execution.event.EventsHandler.triggerInTransaction(EventsHandler.java:327)
	at org.bonitasoft.engine.execution.event.EventsHandler.triggerCatchEvent(EventsHandler.java:390)
	at org.bonitasoft.engine.jobs.TriggerTimerEventJob.execute(TriggerTimerEventJob.java:96)
	at org.bonitasoft.engine.scheduler.impl.JobWrapper.execute(JobWrapper.java:108)
	... 3 more

bonita.log:

2017-07-12 00:45:00.805 +0000 SEVERE: org.bonitasoft.engine.scheduler.impl.JobWrapper THREAD_ID=85 | HOSTNAME=ip-************ | Error while executing job jobName=Timer_Ev_8325391728827622526Iniciar Chequeo;jobId=6001;tenantId=1 : null
java.lang.NullPointerException
	at org.bonitasoft.engine.business.data.proxy.ServerProxyfier.unProxy(ServerProxyfier.java:187)
	at org.bonitasoft.engine.execution.ProcessExecutorImpl.saveBusinessData(ProcessExecutorImpl.java:465)
	at org.bonitasoft.engine.execution.ProcessExecutorImpl.initializeSingleBusinessData(ProcessExecutorImpl.java:447)
	at org.bonitasoft.engine.execution.ProcessExecutorImpl.initializeBusinessData(ProcessExecutorImpl.java:433)
	at org.bonitasoft.engine.execution.ProcessExecutorImpl.initialize(ProcessExecutorImpl.java:385)
	at org.bonitasoft.engine.execution.ProcessExecutorImpl.start(ProcessExecutorImpl.java:822)
	at org.bonitasoft.engine.execution.ProcessExecutorImpl.start(ProcessExecutorImpl.java:792)
	at org.bonitasoft.engine.execution.event.EventsHandler.instantiateProcess(EventsHandler.java:419)
	at org.bonitasoft.engine.execution.event.EventsHandler.triggerCatchEvent(EventsHandler.java:348)
	at org.bonitasoft.engine.execution.event.EventsHandler.access$000(EventsHandler.java:91)
	at org.bonitasoft.engine.execution.event.EventsHandler$1.execute(EventsHandler.java:324)
	at org.bonitasoft.engine.execution.event.EventsHandler.triggerInTransaction(EventsHandler.java:327)
	at org.bonitasoft.engine.execution.event.EventsHandler.triggerCatchEvent(EventsHandler.java:390)
	at org.bonitasoft.engine.jobs.TriggerTimerEventJob.execute(TriggerTimerEventJob.java:96)
	at org.bonitasoft.engine.scheduler.impl.JobWrapper.execute(JobWrapper.java:108)
	at org.bonitasoft.engine.scheduler.impl.AbstractQuartzJob.execute(AbstractQuartzJob.java:36)
	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)

2017-07-12 00:45:00.814 +0000 WARNING: org.bonitasoft.engine.scheduler.impl.JDBCJobListener THREAD_ID=85 | HOSTNAME=ip-********** | bitronix.tm.internal.BitronixRollbackException: transaction has been marked as rollback only
org.bonitasoft.engine.transaction.STransactionNotFoundException: bitronix.tm.internal.BitronixRollbackException: transaction has been marked as rollback only
	at org.bonitasoft.engine.transaction.JTATransactionServiceImpl.registerBonitaSynchronization(JTATransactionServiceImpl.java:253)
	at org.bonitasoft.engine.scheduler.impl.JDBCJobListener.cleanSession(JDBCJobListener.java:156)
	at org.bonitasoft.engine.scheduler.impl.JDBCJobListener.performPostExecutionActions(JDBCJobListener.java:146)
	at org.bonitasoft.engine.scheduler.impl.JDBCJobListener.jobWasExecuted(JDBCJobListener.java:125)
	at org.bonitasoft.engine.scheduler.impl.PlatformQuartzJobListener.jobWasExecuted(PlatformQuartzJobListener.java:64)
	at org.quartz.core.QuartzScheduler.notifyJobListenersWasExecuted(QuartzScheduler.java:1985)
	at org.quartz.core.JobRunShell.notifyJobListenersComplete(JobRunShell.java:340)
	at org.quartz.core.JobRunShell.run(JobRunShell.java:224)
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
Caused by: bitronix.tm.internal.BitronixRollbackException: transaction has been marked as rollback only
	at bitronix.tm.BitronixTransaction.registerSynchronization(BitronixTransaction.java:212)
	at org.bonitasoft.engine.transaction.JTATransactionServiceImpl.registerBonitaSynchronization(JTATransactionServiceImpl.java:251)
	... 8 more

2017-07-12 00:45:00.814 +0000 WARNING: org.bonitasoft.engine.jobs.TimerEventTriggerJobListener THREAD_ID=85 | HOSTNAME=ip-*********** | TENANT_ID=1 | An exception occurs during the deleting of the timer event trigger 'UnixCronTrigger-6970597142798373618'.
org.bonitasoft.engine.persistence.SBonitaReadException: org.bonitasoft.engine.services.SPersistenceException: org.hibernate.HibernateException: Current transaction is not in progress
	at org.bonitasoft.engine.persistence.AbstractHibernatePersistenceService.selectList(AbstractHibernatePersistenceService.java:489)
	at org.bonitasoft.engine.persistence.AbstractDBPersistenceService.searchEntity(AbstractDBPersistenceService.java:156)
	at org.bonitasoft.engine.persistence.AbstractDBPersistenceService.searchEntity(AbstractDBPersistenceService.java:148)
	at org.bonitasoft.engine.core.process.instance.event.impl.EventInstanceServiceImpl.searchEventTriggerInstances(EventInstanceServiceImpl.java:414)
	at org.bonitasoft.engine.jobs.TimerEventTriggerJobListener.deleteTimerEventTrigger(TimerEventTriggerJobListener.java:100)
	at org.bonitasoft.engine.jobs.TimerEventTriggerJobListener.jobWasExecuted(TimerEventTriggerJobListener.java:82)
	at org.bonitasoft.engine.scheduler.impl.TenantQuartzJobListener.jobWasExecuted(TenantQuartzJobListener.java:99)
	at org.quartz.core.QuartzScheduler.notifyJobListenersWasExecuted(QuartzScheduler.java:1985)
	at org.quartz.core.JobRunShell.notifyJobListenersComplete(JobRunShell.java:340)
	at org.quartz.core.JobRunShell.run(JobRunShell.java:224)
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
Caused by: org.bonitasoft.engine.services.SPersistenceException: org.hibernate.HibernateException: Current transaction is not in progress
	at org.bonitasoft.engine.persistence.AbstractHibernatePersistenceService.getSession(AbstractHibernatePersistenceService.java:228)
	at org.bonitasoft.engine.persistence.TenantHibernatePersistenceService.getSession(TenantHibernatePersistenceService.java:103)
	at org.bonitasoft.engine.persistence.AbstractHibernatePersistenceService.selectList(AbstractHibernatePersistenceService.java:450)
	... 10 more
Caused by: org.hibernate.HibernateException: Current transaction is not in progress
	at org.hibernate.context.internal.JTASessionContext.currentSession(JTASessionContext.java:98)
	at org.hibernate.internal.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:1014)
	at org.bonitasoft.engine.persistence.AbstractHibernatePersistenceService.getSession(AbstractHibernatePersistenceService.java:226)
	... 12 more

2017-07-12 00:45:00.816 +0000 WARNING: org.bonitasoft.engine.scheduler.impl.TenantQuartzJobListener THREAD_ID=85 | HOSTNAME=ip-*********** | bitronix.tm.internal.BitronixRollbackException: transaction has been marked as rollback only
org.bonitasoft.engine.transaction.STransactionNotFoundException: bitronix.tm.internal.BitronixRollbackException: transaction has been marked as rollback only
	at org.bonitasoft.engine.transaction.JTATransactionServiceImpl.registerBonitaSynchronization(JTATransactionServiceImpl.java:253)
	at org.bonitasoft.engine.scheduler.impl.TenantQuartzJobListener.cleanSession(TenantQuartzJobListener.java:108)
	at org.bonitasoft.engine.scheduler.impl.TenantQuartzJobListener.jobWasExecuted(TenantQuartzJobListener.java:102)
	at org.quartz.core.QuartzScheduler.notifyJobListenersWasExecuted(QuartzScheduler.java:1985)
	at org.quartz.core.JobRunShell.notifyJobListenersComplete(JobRunShell.java:340)
	at org.quartz.core.JobRunShell.run(JobRunShell.java:224)
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
Caused by: bitronix.tm.internal.BitronixRollbackException: transaction has been marked as rollback only
	at bitronix.tm.BitronixTransaction.registerSynchronization(BitronixTransaction.java:212)
	at org.bonitasoft.engine.transaction.JTATransactionServiceImpl.registerBonitaSynchronization(JTATransactionServiceImpl.java:251)
	... 6 more

I Insist this was working in the previous process version and it’s still working in Studio. We only changed due dates and timers: from minutes (for testing) to days (for production).

Question 1: Any idea whats going on?
Question 2: How can we clear every trace of previous deployments without having to reinstall?

Thank you

Antoine,

After a lot of digging, we realized we were using a previously installed bundle against an empty database.

It created all business and engine tables at startup, but it seems inconsistencies between the filesystem and the database spawned all sort of errors and funny behavior.

Thank you.

I agree that it look like a bug.

Are you able to reproduce with a basic process with only a start timer event and a single step?
Can you let me know which database vendor are you using for your server?

If you disable and delete a process definition it should remove all related data in the Bonita Engine database. Can you indicate in which table you still have data related to delete processes?