当前位置:网站首页>Activit零零碎碎要人命的坑
Activit零零碎碎要人命的坑
2022-07-06 09:30:00 【爱机车的程序猿】
一、配置整合
1.avtivit7依赖Springboot与Spring不同
2.Spring配置activiti7配置文件
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd">
<!-- 数据源 -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://localhost:3306/activiti"/>
<property name="username" value="root"/>
<property name="password" value="123"/>
<property name="maxActive" value="3"/>
<property name="maxIdle" value="1"/>
</bean>
<!-- 工作流引擎配置bean -->
<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
<!-- 数据源 -->
<property name="dataSource" ref="dataSource"/>
<!-- 使用spring事务管理器 -->
<property name="transactionManager" ref="transactionManager"/>
<!-- 数据库策略 -->
<property name="databaseSchemaUpdate" value="true"/>
</bean>
<!--
databaseSchemaUpdate的取值内容:
flase: 默认值。activiti在启动时,会对比数据库表中保存的版本,如果没有表或者版本不匹配,将抛出异常。(生产环境常用)
true: activiti会对数据库中所有表进行更新操作。如果表不存在,则自动创建。(开发时常用)
create_drop: 在activiti启动时创建表,在关闭时删除表(必须手动关闭引擎,才能删除表)。(单元测试常用)
drop-create: 在activiti启动时删除原来的旧表,然后在创建新表(不需要手动关闭引擎)。
-->
<!-- 流程引擎 -->
<bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">
<property name="processEngineConfiguration" ref="processEngineConfiguration"/>
</bean>
<!-- 资源服务service -->
<bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService"/>
<!-- 流程运行service -->
<bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService"/>
<!-- 任务管理service -->
<bean id="taskService" factory-bean="processEngine" factory-method="getTaskService"/>
<!-- 历史管理service -->
<bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService"/>
<!-- 事务管理器 -->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>
<!-- 通知 -->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<!-- 传播行为 -->
<tx:method name="save*" propagation="REQUIRED"/>
<tx:method name="insert*" propagation="REQUIRED"/>
<tx:method name="delete*" propagation="REQUIRED"/>
<tx:method name="update*" propagation="REQUIRED"/>
<tx:method name="find*" propagation="SUPPORTS" read-only="true"/>
<tx:method name="get*" propagation="SUPPORTS" read-only="true"/>
</tx:attributes>
</tx:advice>
<!-- 切面,根据具体项目修改切点配置
<aop:config proxy-target-class="true">
<aop:advisor advice-ref="txAdvice"
pointcut="execution(*com.itheima.service.impl..(..))"/>
</aop:config>-->
</beans>
3.web.xml扫描到配置文件
4.在数据库连接的增加nullCatalogMeansCurrent=true即可。
二、数据库版本
查看pom.xml mysql版本
查看本地mysql版本修改配置
mysql -uroot -p
输入密码
三、实例bug
org.activiti.engine.ActivitiObjectNotFoundException: no processes deployed with key ‘process‘
解决:
activiti 的模版必须以 bpmn20.xml 或者 bpmn结尾
启动流程实例key为部署流程图process 标签下的ID访问页面报:java.lang.ClassCastException: de.odysseus.el.ExpressionFactoryImpl cannot be cast to javax.el.ExpressionFactory
内容报错:
DEBUG [org.springframework.web.servlet.DispatcherServlet] - Error rendering view [org.springframework.web.servlet.view.JstlView: name ‘adMatching’; URL [/WEB-INF/page/adMatching.jsp]] in DispatcherServlet with name ‘SpringMvc’
org.apache.jasper.JasperException: Unable to compile class for JSP
activiti6解决:与项目中el表达式jar包冲突的问题过滤掉这个jar包就好
<exclusions>
<exclusion>
<groupId>de.odysseus.juel</groupId>
<artifactId>juel-api</artifactId>
</exclusion>
</exclusions>
activiti7解决:与项目中el表达式jar包冲突的问题过滤掉这个jar包就好
<exclusions>
<exclusion>
<groupId>de.odysseus.juel</groupId>
<artifactId>juel-api</artifactId>
</exclusion>
</exclusions>
<exclusions>
<exclusion>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
</exclusion>
</exclusions>
- 配置多数据源
边栏推荐
- Mp4 format details
- Shell_ 00_ First meeting shell
- Cmake Express
- 字节跳动多篇论文入选 CVPR 2021,精选干货都在这里了
- Audio and video development interview questions
- ~83 form introduction
- LeetCode 1557. The minimum number of points that can reach all points
- Shell_ 07_ Functions and regular expressions
- [unsolved] 7-15 shout mountain
- DS18B20數字溫度計系統設計
猜你喜欢
How to configure hosts when setting up Eureka
~85 transition
算数运算指令
Redis standalone startup
逻辑运算指令
Data config problem: the reference to entity 'useunicode' must end with ';' delimiter.
Basic principles of video compression coding and audio compression coding
[graduation project] QT from introduction to practice: realize imitation of QQ communication, which is also the last blog post in school.
字节跳动2022校招研发提前批宣讲会,同学们最关心的10个问题
数据传送指令
随机推荐
~71 abbreviation attribute of font
LeetCode 1562. Find the latest group of size M
Shell_ 03_ environment variable
谢邀,人在工区,刚交代码,在下字节跳动实习生
8086 CPU 内部结构
Many papers on ByteDance have been selected into CVPR 2021, and the selected dry goods are here
字节跳动技术新人培训全记录:校招萌新成长指南
原型链继承
TypeScript基本操作
@RestController、@Controller
字节跳动技术面试官现身说法:我最想pick什么样的候选人
Eureka high availability
Mp4 format details
Some instructions on whether to call destructor when QT window closes and application stops
数据传送指令
Shell_ 06_ Judgment and circulation
Solr new core
The 116 students spent three days reproducing the ByteDance internal real technology project
字节跳动春招攻略:学长学姐笔经面经,还有出题人「锦囊」
redux使用说明