[JBoss jBPM] - Timer ; exception ; Hibernate
by JimKnopf
Hi again,
I have a Timer and let it execute an action.
After the Timer execute the Action i got a Exception when the TimerThread want to close his JBPMContext.
Can some one help and tell me what's wrong?
Processdefinition:
| String processDefinition = "<process-definition name='Timos die erste'>" + " <swimlane name='ingo'>"
| + " <assignment expression='user(ingo)'></assignment>" + " </swimlane>"
|
| + " <swimlane name='tanja'>" + " <assignment expression='user(tanja)'></assignment>"
| + " </swimlane>"
|
| + " <start-state name='start'>" + " <transition name='transition 1' to='tasknode1' />"
| + " </start-state>"
|
| + " <task-node name='tasknode1'>" + " <task name='Test Tasknote1' swimlane='tanja'>"
| + " <timer name='ContentExpired' duedate='3 seconds' transition='timeUp' >"
| + " <action class='actions.actionTest2'>" + " </action>" + " </timer>" + " <controller>"
| + " <variable name='age' access='read,write'></variable>"
| + " <variable name='age1' access='read'></variable>"
| + " <variable name='age11' access='read'></variable>"
| + " <variable name='age111' access='read,write'></variable>"
| + " <variable name='age1111' access='read,write'></variable>"
| + " <variable name='age11111' access='read'></variable>"
| + " <variable name='age111111' access='read'></variable>"
| + " <variable name='age1111111' access='read,write'></variable>"
| + " <variable name='age11111111' access='read,write'></variable>"
| + " <variable name='age111111111' access='read,write'></variable>" + " </controller>"
| + " </task>" + " <transition name='transition 2' to='tasknode2'></transition>"
| + " <transition name='timeUp' to='end'></transition>" + " </task-node>"
|
| + " <task-node name='tasknode2'>" + " <task name='Test Tasknote2' swimlane='tanja'>"
| + " <controller>" + " <variable name='age' access='read,write,required'></variable>"
| + " </controller>" + " </task>" + " <transition name='transition 22' to='Timo 1'></transition>"
| + " </task-node>"
|
| + " <state name='Timo 1'>" + " <transition name='transition 3' to='end'/>" + " </state>"
|
| + " <end-state name='end' />" + "</process-definition>";
|
The Schedular:
| private void initSchedular () {
| // java SchedulerMain <interval> <historyMaxSize> <dateFormat>
|
| // create a new scheduler
| Scheduler scheduler = new Scheduler();
|
| // initialize it with the command line parameters
| int interval = 5000;
| scheduler.setInterval(interval);
| int historyMaxSize = 50;
| scheduler.setHistoryMaxSize(historyMaxSize);
| DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
|
| // start the scheduler
| scheduler.start();
|
| // register the console listener
| scheduler.getSchedulerThread().addListener( new LogListener(dateFormat) );
| }
|
The Exception
anonymous wrote :
| 09:13:48,375 [JbpmScheduler] DEBUG JbpmContextInfo : creating jbpm context with service factories '[message, scheduler, authentication, persistence, logging]'
| 09:13:48,375 [JbpmScheduler] DEBUG JbpmContext : creating JbpmContext
| 09:13:48,375 [JbpmScheduler] DEBUG DbPersistenceServiceFactory : creating persistence service
| 09:13:48,375 [JbpmScheduler] DEBUG DbPersistenceService : creating hibernate session
| 09:13:48,375 [JbpmScheduler] DEBUG DbPersistenceService : beginning hibernate transaction
| 09:13:48,375 [JbpmScheduler] DEBUG SchedulerThread : checking for timers
| My Timer-Action!
| 09:13:48,406 [JbpmScheduler] DEBUG SchedulerThread : found timer timer(ContentExpired,actions.actionTest2,09:13:48,047)
| 09:13:48,406 [JbpmScheduler] DEBUG SchedulerThread : executing timer 'timer(ContentExpired,actions.actionTest2,09:13:48,047)'
| 09:13:48,421 [JbpmScheduler] DEBUG Timer : executing timer 'timer(ContentExpired,actions.actionTest2,09:13:48,047)'
| 09:13:48,421 [JbpmScheduler] DEBUG GraphElement : event 'before-signal' on 'TaskNode(tasknode1)' for 'Token(/)'
| 09:13:48,421 [JbpmScheduler] DEBUG GraphElement : event 'node-leave' on 'TaskNode(tasknode1)' for 'Token(/)'
| 09:13:48,421 [JbpmScheduler] DEBUG GraphElement : event 'transition' on 'Transition(timeUp)' for 'Token(/)'
| 09:13:48,437 [JbpmScheduler] DEBUG GraphElement : event 'node-enter' on 'EndState(end)' for 'Token(/)'
| 09:13:48,437 [JbpmScheduler] DEBUG GraphElement : event 'process-end' on 'ProcessDefinition(Timos die erste)' for 'Token(/)'
| 09:13:48,453 [JbpmScheduler] DEBUG GraphElement : event 'after-signal' on 'TaskNode(tasknode1)' for 'Token(/)'
| 09:13:48,453 [JbpmScheduler] DEBUG Services : executing default save operations
| 09:13:48,453 [JbpmScheduler] DEBUG HibernateSaveOperation : saving process instance
| 09:13:48,453 [JbpmScheduler] DEBUG SaveLogsOperation : flushing logs to logging service.
| 09:13:48,468 [JbpmScheduler] DEBUG CascadeSaveOperation : cascading save of 'org.jbpm.graph.exe.ProcessInstance@11a6631'
| 09:13:48,468 [JbpmScheduler] INFO TestFrame$LogListener : 23/11/2006 09:13:48 | timer(ContentExpired,actions.actionTest2,09:13:48,047) | OK |
| 09:13:48,468 [JbpmScheduler] DEBUG SchedulerThread : deleting timer 'timer(ContentExpired,actions.actionTest2,09:13:48,047)'
| 09:13:48,468 [JbpmScheduler] DEBUG JbpmContext : closing JbpmContext
| 09:13:48,468 [JbpmScheduler] DEBUG Services : closing service 'persistence': org.jbpm.persistence.db.DbPersistenceService@1c7510d
| 09:13:48,468 [JbpmScheduler] DEBUG DbPersistenceService : committing hibernate transaction
| 09:13:48,484 [JbpmScheduler] ERROR AbstractFlushingEventListener : Could not synchronize database state with session
| org.hibernate.StaleStateException: Unexpected row count: 0 expected: 1
| at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:27)
| at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2291)
| at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2440)
| at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:65)
| at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:243)
| at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:227)
| at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:145)
| at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:296)
| at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
| at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:980)
| at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:353)
| at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
| at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:162)
| at org.jbpm.svc.Services.close(Services.java:211)
| at org.jbpm.JbpmContext.close(JbpmContext.java:139)
| at org.jbpm.scheduler.impl.SchedulerThread.executeTimers(SchedulerThread.java:161)
| at org.jbpm.scheduler.impl.SchedulerThread.run(SchedulerThread.java:70)
| org.jbpm.persistence.JbpmPersistenceException: couldn't commit hibernate session
| at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:172)
| at org.jbpm.svc.Services.close(Services.java:211)
| at org.jbpm.JbpmContext.close(JbpmContext.java:139)
| at org.jbpm.scheduler.impl.SchedulerThread.executeTimers(SchedulerThread.java:161)
| at org.jbpm.scheduler.impl.SchedulerThread.run(SchedulerThread.java:70)
| Caused by: org.hibernate.StaleStateException: Unexpected row count: 0 expected: 1
| at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:27)09:13:48,500 [JbpmScheduler] ERROR Services : problem closing service 'persistence'
| org.jbpm.persistence.JbpmPersistenceException: couldn't commit hibernate session
| at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:172)
| at org.jbpm.svc.Services.close(Services.java:211)
| at org.jbpm.JbpmContext.close(JbpmContext.java:139)
| at org.jbpm.scheduler.impl.SchedulerThread.executeTimers(SchedulerThread.java:161)
| at org.jbpm.scheduler.impl.SchedulerThread.run(SchedulerThread.java:70)
| Caused by: org.hibernate.StaleStateException: Unexpected row count: 0 expected: 1
| at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:27)
| at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2291)
| at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2440)
| at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:65)
| at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:243)
| at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:227)
| at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:145)
| at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:296)
| at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
| at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:980)
| at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:353)
| at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
| at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:162)
| ... 4 more
| 09:13:48,500 [JbpmScheduler] DEBUG Services : closing service 'scheduler': org.jbpm.scheduler.db.DbSchedulerService@c524dd
| 09:13:48,500 [JbpmScheduler] DEBUG Services : closing service 'logging': org.jbpm.logging.db.DbLoggingService@f757b9
| 09:13:48,500 [JbpmScheduler] INFO SchedulerThread : runtime exception while executing timers
| org.jbpm.JbpmException: problem closing services {persistence=org.jbpm.persistence.JbpmPersistenceException: couldn't commit hibernate session}
| at org.jbpm.svc.Services.close(Services.java:223)
| at org.jbpm.JbpmContext.close(JbpmContext.java:139)
| at org.jbpm.scheduler.impl.SchedulerThread.executeTimers(SchedulerThread.java:161)
| at org.jbpm.scheduler.impl.SchedulerThread.run(SchedulerThread.java:70)
| Caused by: org.jbpm.persistence.JbpmPersistenceException: couldn't commit hibernate session
| at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:172)
| at org.jbpm.svc.Services.close(Services.java:211)
| ... 3 more
| Caused by: org.hibernate.StaleStateException: Unexpected row count: 0 expected: 1
| at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:27)
| at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2291)
| at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2440)
| at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:65)
| at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:243)
| at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:227)
| at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:145)
| at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:296)
| at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
| at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:980)
| at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:353)
| at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
| at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:162)
| ... 4 more
|
| at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2291)
| at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2440)
| at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:65)
| at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:243)
| at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:227)
| at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:145)
| at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:296)
| at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
| at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:980)
| at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:353)
| at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
| at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:162)
| ... 4 more
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3988076#3988076
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3988076
19Â years, 5Â months
[EJB/JBoss] - Pessimistic Locking strange behaviour with read-only pattern
by Oyabun
Hi!
Everytime I use a read-only pattern(get*) on my EntityBean, the pessimistic locking stops working (for other methods also)! It behaves just like optimistic locking. I experimented for a few days, I read the forums and the JBoss 4.0 Book, there is nothing on this behaviour.
some of the xdoclet tags (the ones that count):
| /**
| * Autogenerated EJB implementation class for SystemKontoEB
| *
| *
| *
| * @ejb.bean
| * generate = "true"
| * name = "SystemKontoEB"
| * type = "CMP"
| * cmp-version = "2.x"
| * view-type = "local"
| * local-jndi-name = "ejb/SystemKontoEB"
| * reentrant = "true"
| *
| * @jboss.container-configuration
| * name = "Standard CMP 2.x EntityBean Pessimistic"
| *
| * @jboss.cache-invalidation
| * value = "true"
| *
| * @jboss.cache-invalidation-config
| * invalidation-group-name = "SystemKontoEBGroup"
| *
| * @jboss.tuned-updates
| *
| * @jboss.entity-command
| * name = "no-select-before-insert"
| *
| * @jboss.read-ahead
| * strategy = "on-load"
| * page-size = "20"
| *
| * @ejb.util
| * generate = "physical"
| *
| * @ejb.transaction
| * type = "Required"
| *
| * @ejb.persistence
| * table-name = "SYSTEMKONTO"
| *
| * @jboss.method-attributes
| * pattern = "get*"
| * read-only = "true"
| */
|
"Standard CMP 2.x EntityBean Pessimistic" is the same as "Standard CMP 2.x EntityBean" only with the modifications below. I use my own invalidation methods, if you wonder why i do this.
| <locking-policy>org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock</locking-policy>
|
Any ideas why the read-only method tag (get*) would interfere with the pessimistic locking of other methods which don't match the get* pattern?
-> JBoss 4.0.2
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3988074#3988074
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3988074
19Â years, 5Â months
[EJB/JBoss] - Need help on java.lang.NoSuchMethod exception
by scout1lacno
Hi all,
Im stuck with this for quite a time now.
The situation is that im developing an EJB application. I have JBOSS-4.0.4.GA app server in my local machine( Windows 2000 ) and JBOSS-4.0.4.GA in the remote machine (Linux).
When I deploy my apps on my local server there is no exception. But when I deploy my ear file on the remote machine an exception occur...
The exception probably occur when I added a new method in my facade and facade local (TblMessagesFacade) and deploy it to the remote server. In my local machine there is no exception. The remote server doesnt seem to recognize the new method.
The problem was solve by creating a new facade (TblMessageFacade)(TblMessageFacadeLocal)
Does anyone have an idea why the exception happen? I erased the tmp file in the remote server. Restart the server.. check up the ear and the modification was there.. But again the server keeps on producing the error.
Any ideas?
Thankz so mch :)
Exception:
java.lang.NoSuchMethodError: ph.icomm.ibccrm.entity.TblCSCSubCategoryFacadeLocal.updateUnreadMailLocal(Ljava/lang/Short;Ljava/lang/Short;)V
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3988069#3988069
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3988069
19Â years, 5Â months