[jBPM Users] - Re: StaleObjectException in JBPM 4.0
by kukeltje
"mmusaji" wrote : I don't mind being a guinea pig. I hope this helps other people who have the same issue.
|
Not only others, also us (creating awareness)
"mmusaji" wrote :
| Most of what you guys are saying is going over my head, however I think if the teardown waited for the process to finish this would resolve this problem quite quickly.
|
Then you at least got my main point ;-)
"mmusaji" wrote :
| If I wanted to do this and override the tear down method in my Junit can you please post an example of how I would go about this? Would be a large amount of code involving checking the db or is there "isAlive()" method somewhere?
The source of the AbstractDBTestcase is the basis. But just before deleting it, retrieve the processinstance based on the id, if this succeeds,, sleep, then retrieve it again based on the processInstance id. If this returns null, it is ended and you can delete it
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4251593#4251593
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4251593
16 years, 7 months
[jBPM Users] - Re: StaleObjectException in JBPM 4.0
by kukeltje
Sorry, to little info from my side.
If you *do* end the process in the unit test because you want to *know* it has ended, the teardown throws an exception.
And I agree that it is much easier for us to use, but as you already mention, the 'confusion' kicks in very often. Also many people do not know the new assertions.
Maybe the teardown should check if it is still running and do the sleep itself until it checks that the process has ended or sleeps 10 seconds and then kill it anyway (but maybe also delete running jobs etc)
Off Topic: so maybe a very little amount of data could be left in the execution table e.g. the process instance id and the fact that it has ended or whatever. This one record does not really clutter the db does it? Or in some command check if there is a process id in the history table if the execution returns null, more explicit warnings can be thrown then. Tom changed the getVariable to log a message that there is no process instance but there is not process instance ACTIVE anymore. Could also be kind of confusing. And instead of documenting all this, it is probably easier to log it in a nicer way.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4251541#4251541
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4251541
16 years, 7 months
[jBPM Users] - JBPM4 Spring Integration Issue - No platformTransaction mana
by faisalgeek
Our application is already spring + hibernate based, I am troubling to integrate your supposed jbpm spring integration method.
We already have, applicatonContext.cfg.xml, hibernate.cfg.xml & spring have a named session factory plus transaction manger & its configured with MS MSQL server.
Now, I have setup MySQL database for jbpm, now what should config files & architecture should have?
Please, tell me the what is problem, that i am getting below exception ????
jbpm.cfg.xml - JBPM Configurations
<?xml version="1.0" encoding="UTF-8"?>
<jbpm-configuration xmlns="http://jbpm.org/xsd/cfg">
<process-engine-context>
<repository-service />
<repository-cache />
<execution-service />
<history-service />
<management-service />
<task-service />
<identity-service />
<command-service>
<retry-interceptor />
<environment-interceptor />
<spring-transaction-interceptor current="true"/>
<!--<spring-transaction-interceptor />-->
</command-service>
<hibernate-configuration>
</hibernate-configuration>
<deployer-manager>
<jpdl-deployer />
</deployer-manager>
<script-manager default-expression-language="juel"
default-script-language="juel"
read-contexts="execution, environment, process-engine"
write-context="">
<script-language name="juel" factory="org.jbpm.pvm.internal.script.JuelScriptEngineFactory" />
</script-manager>
<job-executor auto-start="false" />
<id-generator />
<business-calendar>
</business-calendar>
</process-engine-context>
<transaction-context>
<repository-session />
<pvm-db-session />
<job-db-session />
<task-db-session />
<message-session />
<timer-session />
<history-session />
<hibernate-session />
<hibernate-session current="true" />
<identity-session />
</transaction-context>
</jbpm-configuration>
jbpm.hibernate.cfg.xml â JBPM Hibernate Configurations
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory name="jbpm4-spring">
false
</session-factory>
</hibernate-configuration>
Spring Application Context Configurations
My applicationâÂÂs existing spring + hibernate configration
classpath:com/netsol/unittest/config/hibernate.cfg.xml
<bean id="hibernateConfiguration" factory-bean="&sessionFactory"
factory-method="getConfiguration">
<tx:annotation-driven transaction-manager="transactionManager"/>
JBPM + Spring Configurations
<constructor-arg>
com/netsol/unittest/config/jbpm.cfg.xml
</constructor-arg>
org.hibernate.dialect.MySQLDialect
<!-- true
create-drop
-->
classpath:com/netsol/config/jbpm.hibernate.cfg.xml
classpath:jbpm.execution.hbm.xml
classpath:jbpm.repository.hbm.xml
classpath:jbpm.jpdl.hbm.xml
classpath:jbpm.task.hbm.xml
classpath:jbpm.history.hbm.xml
<aop:aspectj-autoproxy/>
<tx:advice id="txAdvice" transaction-manager="txManager">
<tx:attributes>
<tx:method name="get*" read-only="true" propagation="SUPPORTS" />
<tx:method name="find*" read-only="true" propagation="SUPPORTS" />
<tx:method name="*" propagation="REQUIRED" />
</tx:attributes>
</tx:advice>
<aop:config>
<aop:pointcut id="serviceOperation" expression="execution(* com.netsol.manager.impl.wf.**.*(..))" type="regex" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="serviceOperation" />
</aop:config>
<bean id="processEngine" factory-bean="jbpmConfiguration"
factory-method="buildProcessEngine" />
<bean id="repositoryService" factory-bean="processEngine"
factory-method="getRepositoryService" />
<bean id="executionService" factory-bean="processEngine"
factory-method="getExecutionService" />
<bean id="historyService" factory-bean="processEngine"
factory-method="getHistoryService" />
<bean id="managementService" factory-bean="processEngine"
factory-method="getManagementService" />
<bean id="taskService" factory-bean="processEngine"
factory-method="getTaskService" />
Exception I am gettingâ¦.. while testing my existing applicationâÂÂs configuration integrated with newly spring jpbm configuration.
org.jbpm.api.JbpmException: No platformTransaction manager defined.
at org.jbpm.pvm.internal.tx.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:60)
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.repository.DeploymentImpl.deploy(DeploymentImpl.java:89)
at com.netsol.manager.impl.wf.BPMService.deployProcess(BPMService.java:40)
at com.netsol.manager.impl.wf.BPMService$$FastClassByCGLIB$$e25347d6.invoke()
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:696)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:631)
at com.netsol.manager.impl.wf.BPMService$$EnhancerByCGLIB$$4ff49598.deployProcess()
at com.netsol.manager.impl.wf.WorkFlowManagerImpl.generateProcessesJBPM(WorkFlowManagerImpl.java:1020)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:301)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy18.generateProcessesJBPM(Unknown Source)
at com.netsol.unittest.wf.WorkFlowManagerTest.testGenerateProcessesJBPM(WorkFlowManagerTest.java:75)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:91)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4251524#4251524
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4251524
16 years, 7 months