当前位置:网站首页>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>

- 配置多数据源
边栏推荐
- ~86m rabbit practice
- 这群程序员中的「广告狂人」,把抖音广告做成了AR游戏
- koa中间件
- Solve the single thread scheduling problem of intel12 generation core CPU (II)
- 7-8 likes (need to continue to improve)
- The most lost road I have ever walked through is the brain circuit of ByteDance programmers
- 这116名学生,用3天时间复刻了字节跳动内部真实技术项目
- 7-12 inventory code base
- 亮相Google I/O,字节跳动是这样应用Flutter的
- ~72 horizontal and vertical alignment of text
猜你喜欢

「博士毕业一年,我拿下 ACL Best Paper」

~86m rabbit practice

逻辑运算指令

~82 style of table

Shell_ 02_ Text three swordsman

Basic principles of video compression coding and audio compression coding

汇编课后作业

Eureka single machine construction

Fdog series (4): use the QT framework to imitate QQ to realize the login interface, interface chapter.

How to configure hosts when setting up Eureka
随机推荐
Many papers on ByteDance have been selected into CVPR 2021, and the selected dry goods are here
Shell_ 02_ Text three swordsman
[graduation project] QT from introduction to practice: realize imitation of QQ communication, which is also the last blog post in school.
Audio and video development interview questions
Error occurred during initialization of VM Could not reserve enough space for object heap
~85 transition
这群程序员中的「广告狂人」,把抖音广告做成了AR游戏
redux使用说明
LeetCode 1641. Count the number of Lexicographic vowel strings
Mongodb在node中的使用
DS18B20數字溫度計系統設計
LeetCode 1637. The widest vertical area between two points without any point
js垃圾回收机制和内存泄漏
README. txt
LeetCode 1984. Minimum difference in student scores
Saw local status change event StatusChangeEvent [timestamp=1644048792587, current=DOWN, previous=UP]
这116名学生,用3天时间复刻了字节跳动内部真实技术项目
我走過最迷的路,是字節跳動程序員的腦回路
Description of project structure configuration of idea
Alibaba cloud server docker installation mysql5.5