当前位置:网站首页>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>
- 配置多数据源
边栏推荐
- @RestController、@Controller
- ~81 long table
- Thank you for your invitation. I'm in the work area. I just handed in the code. I'm an intern in the next ByteDance
- QT system learning series: 1.2 style sheet sub control lookup
- GCC error: terminate called after throwing an instance of 'std:: regex_ error‘ what(): regex
- 字节跳动2022校招研发提前批宣讲会,同学们最关心的10个问题
- Train 100 pictures for 1 hour, and the style of the photos changes at will. There is a demo at the end of the article | siggraph 2021
- 7-8 likes (need to continue to improve)
- LeetCode 1584. Minimum cost of connecting all points
- Conception du système de thermomètre numérique DS18B20
猜你喜欢
字节跳动技术面试官现身说法:我最想pick什么样的候选人
Thank you for your invitation. I'm in the work area. I just handed in the code. I'm an intern in the next ByteDance
redux使用说明
7-10 punch in strategy
逻辑运算指令
~86m rabbit practice
~82 style of table
J'ai traversé le chemin le plus fou, le circuit cérébral d'un programmeur de saut d'octets
TCP的三次握手和四次挥手
koa中间件
随机推荐
[graduation project] QT from introduction to practice: realize imitation of QQ communication, which is also the last blog post in school.
「博士毕业一年,我拿下 ACL Best Paper」
QT system learning series: 1.2 style sheet sub control lookup
100张图训练1小时,照片风格随意变,文末有Demo试玩|SIGGRAPH 2021
LeetCode 1551. Minimum operand to make all elements in the array equal
LeetCode 1562. Find the latest group of size M
Solr new core
Fdog series (4): use the QT framework to imitate QQ to realize the login interface, interface chapter.
~84 form supplement
How to generate six digit verification code
Eureka high availability
~78 radial gradient
面试集锦库
我走过最迷的路,是字节跳动程序员的脑回路
LeetCode 1558. Get the minimum number of function calls of the target array
LeetCode 1545. Find the k-th bit in the nth binary string
Shell_ 04_ Shell script
Record the error reason
Business system compatible database oracle/postgresql (opengauss) /mysql Trivia
Mp4 format details