当前位置:网站首页>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>
- 配置多数据源
边栏推荐
猜你喜欢
Solr standalone installation
SQL quick start
Use JQ to realize the reverse selection of all and no selection at all - Feng Hao's blog
Shell_ 07_ Functions and regular expressions
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
~82 style of table
Shell_ 01_ data processing
Shell_ 03_ environment variable
I'm "fixing movies" in ByteDance
原型链继承
随机推荐
~76 sprite map
ByteDance 2022 school recruitment R & D advance approval publicity meeting, students' top 10 issues
字节跳动海外技术团队再夺冠:高清视频编码已获17项第一
Codeforces Global Round 19
~84 form supplement
面试集锦库
Fdog series (III): use Tencent cloud SMS interface to send SMS, write database, deploy to server, web finale.
Use JQ to realize the reverse selection of all and no selection at all - Feng Hao's blog
TypeScript基本操作
~69 other ways to use icon fonts
Fdog series (V): use QT to imitate QQ to realize login interface to main interface, function chapter.
string. How to choose h and string and CString
~81 long table
Alibaba cloud server docker installation mysql5.5
The daemon thread starts redis and modifies the configuration file
Typescript basic operations
Restful style interface design
LeetCode 1638. Count the number of substrings with only one character difference
Business system compatible database oracle/postgresql (opengauss) /mysql Trivia
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