05-29-2012 01:19 PM
public void deployProcess(string resourceName, InputStream inputStream)
DeploymentBuilder deploymentBuilder = repositoryService.createDeployment();
deploymentBuilder.name(resourceName);
deploymentBuilder.addInputStream(resourceName, inputStream);
deploymentBuilder.deploy();
}
Everything went well. It was deployed and successful parsed.
private void startProcess(String businessKey, String processDefinitionKey) {
runtimeService.startProcessInstanceByKey(processDefinitionKey, businessKey);
}
It works nicely. I can create as many as I want, complete the task, and so on. No problem till now!
private void startProcess(String businessKey, String processDefinitionKey) {
runtimeService.startProcessInstanceByKey(processDefinitionKey, businessKey);
}
It gives me this error:
May 29, 2012 6:11:37 PM org.activiti.engine.impl.interceptor.CommandContext close
SEVERE: Error while closing command context
org.springframework.transaction.TransactionSystemException: JTA failure on resume; nested exception is bitronix.tm.internal.BitronixSystemException: cannot resume a Bitronix Transaction with GTRID [7669616E6F6269732D636C75737465722D6E6F646530000001379994D54500001B7C], status=ACTIVE, 1 resource(s) enlisted (started Tue May 29 18:11:37 WEST 2012), error=XAER_DUPID
at org.springframework.transaction.jta.JtaTransactionManager.doResume(JtaTransactionManager.java:949)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.resume(AbstractPlatformTransactionManager.java:624)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.cleanupAfterCompletion(AbstractPlatformTransactionManager.java:1017)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:804)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:147)
at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
at org.activiti.engine.impl.db.DbIdGenerator.getNewBlock(DbIdGenerator.java:42)
at org.activiti.engine.impl.db.DbIdGenerator.getNextId(DbIdGenerator.java:34)
at org.activiti.engine.impl.db.DbSqlSession.insert(DbSqlSession.java:104)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.insert(ExecutionEntity.java:1029)
at org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity.newProcessInstance(ProcessDefinitionEntity.java:137)
at org.activiti.engine.impl.pvm.process.ProcessDefinitionImpl.createProcessInstanceForInitial(ProcessDefinitionImpl.java:58)
at org.activiti.engine.impl.pvm.process.ProcessDefinitionImpl.createProcessInstance(ProcessDefinitionImpl.java:48)
at org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity.createProcessInstance(ProcessDefinitionEntity.java:67)
at org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity.createProcessInstance(ProcessDefinitionEntity.java:126)
at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:66)
at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:31)
at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42)
at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
at org.activiti.engine.impl.RuntimeServiceImpl.startProcessInstanceByKey(RuntimeServiceImpl.java:50)
//Creates a new deployment, empty! Don't know why, but if not, creating a new process instance will not work!
repositoryService.createDeployment().deploy();
06-01-2012 05:13 AM
06-01-2012 07:03 AM
<property name="jdbcUrl" value="jdbc:h2:mem:activiti;DB_CLOSE_DELAY=1000" />
<property name="jdbcUrl" value="jdbc:h2:tcp://localhost/activiti" />
06-01-2012 08:00 AM
(…)
<persistence-unit name="WorkflowPU_3" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/comp/env/jdbc/WorkflowDB_3</jta-data-source>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect" />
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.BTMTransactionManagerLookup" />
<property name="jta.UserTransaction" value="java:comp/UserTransaction" />
<property name="javax.persistence.transactionType" value="jta" />
<property name="hibernate.current_session_context_class" value="jta" />
<property name="hibernate.archive.autodetection" value="none" />
<property name="hibernate.cache.use_second_level_cache" value="false" />
<property name="hibernate.query.plan_cache_max_strong_references" value="1024" />
<property name="hibernate.query.plan_cache_max_soft_references" value="4096" />
<property name="hibernate.connection.isolation" value="2" />
<property name="hibernate.connection.release_mode" value="after_statement" />
</properties>
</persistence-unit>
(…)
<!– create BTM transaction manager –>
<bean id="BitronixTransactionManager" factory-method="getTransactionManager" class="bitronix.tm.TransactionManagerServices" destroy-method="shutdown" />
<!– Spring JtaTransactionManager –>
<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="transactionManager" ref="BitronixTransactionManager" />
<property name="userTransaction" ref="BitronixTransactionManager" />
</bean>
<bean id="entityManagerFactory3" depends-on="BitronixTransactionManager" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="persistenceUnitName" value="WorkflowPU_3" />
</bean>
<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
<property name="databaseSchemaUpdate" value="true" />
<property name="transactionManager" ref="transactionManager" />
<property name="dataSourceJndiName" value="java:/comp/env/jdbc/WorkflowDB_3" />
<property name="jpaEntityManagerFactory" ref="entityManagerFactory3" />
<property name="jpaHandleTransaction" value="true" />
<property name="jpaCloseEntityManager" value="false" />
<property name="jobExecutorActivate" value="false" />
<property name="transactionsExternallyManaged" value="true" />
<property name="history" value="full" />
</bean>
<bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">
<property name="processEngineConfiguration" ref="processEngineConfiguration" />
</bean>
06-01-2012 01:46 PM
<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
(…)
<property name="idGenerator">
<bean class="org.activiti.engine.impl.persistence.StrongUuidGenerator" />
</property>
<property name="idBlockSize" value="2000" />
(…)
</bean>
Remember to include java-uuid-generator-3.1.2.jar in your classpathTags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.