[
https://jira.jboss.org/jira/browse/JBPM-2817?page=com.atlassian.jira.plug...
]
Huisheng Xu resolved JBPM-2817.
-------------------------------
Assignee: Huisheng Xu
Fix Version/s: jBPM 4.4
Resolution: Out of Date
Because it is based on jBPM-4.0 and there is no more information for it, I marked it as
out of date. If someone could reproduce it, please reopen it.
Repeat Timer Issue
------------------
Key: JBPM-2817
URL:
https://jira.jboss.org/jira/browse/JBPM-2817
Project: jBPM
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Runtime Engine
Affects Versions: jBPM 4.0
Environment: Spring 3.0 JDK 1.6
Reporter: Sean Mo
Assignee: Huisheng Xu
Fix For: jBPM 4.4
This happened on jBPM 4.0. Initially I defined a normal timer in my process definition,
it worked well but after I changed it to a repeat timer (by adding repeat="30
seconds"), I encountered the following exception:
Mar 4, 2010 5:40:35 PM org.jbpm.internal.log.Jdk14Log error SEVERE: exception while
executing 'timer[23|2010-03-04 17:41:05,391|TimeoutEvent]'
org.jbpm.api.JbpmException: no transaction in environment
at org.jbpm.pvm.internal.job.TimerImpl.execute(TimerImpl.java:150)
at org.jbpm.pvm.internal.job.TimerImpl.execute(TimerImpl.java:52)
at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:74)
at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:41)
at
org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
at
org.jbpm.pvm.internal.spring.CommandTransactionCallback.doInTransaction(CommandTransactionCallback.java:50)
at
org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)
at
org.jbpm.pvm.internal.tx.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:79)
at
org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:54)
at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
at org.jbpm.pvm.internal.jobexecutor.JobExecutorThread.run(JobExecutorThread.java:63)
Here's my timer definition:
<custom expr="#{customWaitActivity}" name="Custom Wait"
g="411,174,126,52">
<on event="TimeoutEvent">
<!--<timer duedate="30 seconds" />-->
<timer duedate="30 seconds" repeat="30 seconds" />
<event-listener
class="jbpm.demo.wf.spring.SpringEventListenerDelegate">
<field name="beanName">
<string value="timerExpireHandler" />
</field>
</event-listener>
</on>
</custom>
Spring is used to control all the transactions in my project. All the other functions
work fine so I think this may be a Spring integration bug of Timer. Here's my Sping
Transaction config:
<tx:annotation-driven transaction-manager="transactionManager" />
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="demoDatasource" />
<property
name="exposeTransactionAwareSessionFactory"><value>true</value></property>
<property name="hibernateProperties">
<props>
<prop
key="hibernate.dialect">org.hibernate.dialect.DB2Dialect</prop>
<prop key="hibernate.format_sql">false</prop>
<prop key="hibernate.show_sql">false</prop>
<prop key="use_sql_comments">false</prop>
<prop key="hibernate.hbm2ddl.auto">none</prop>
</props>
</property>
<property name="mappingLocations">
<list>
<value>classpath:jbpm.execution.hbm.xml</value>
<value>classpath:jbpm.repository.hbm.xml</value>
<value>classpath:jbpm.task.hbm.xml</value>
<value>classpath:jbpm.history.hbm.xml</value>
<value>classpath:jbpm.identity.hbm.xml</value>
</list>
</property>
</bean>
And jbpm.cfg.xml is properly set up according to the jbpm doc as below.
...
<job-executor threads="2" idle="20000" lock="2400000"
auto-start="true" init="immediate" />
<!-- Here we needed to change the transaction interceptor -->
<command-service>
...
<spring-transaction-interceptor />
</command-service>
...
<!-- Added spring as read-context -->
<script-manager default-expression-language="juel"
default-script-language="juel" read-contexts="execution, environment,
process-engine, spring" write-context="">
<script-language name="juel"
factory="org.jbpm.pvm.internal.script.JuelScriptEngineFactory" />
</script-manager>
...
<transaction-context>
...
<hibernate-session current="true" />
</transaction-context>
...
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira