一次使用SSH和Activiti6开发的项目中,在服务器启动的时候就报错:
org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: java.sql.SQLSyntaxErrorException: Table 'activiti.act_ge_property' doesn't exist
### The error may exist in org/activiti/db/mapping/entity/Property.xml
### The error may involve org.activiti.engine.impl.persistence.entity.PropertyEntityImpl.selectProperty-Inline
### The error occurred while setting parameters
### SQL: select * from ACT_GE_PROPERTY where NAME_ = ?
### Cause: java.sql.SQLSyntaxErrorException: Table 'activiti.act_ge_property' doesn't exist
查找表不存在?Activiti没有自动建表?
可配置文件确实将databaseSchemaUpdate属性设置为了true,这意味着activiti会执行无表创建,有表更新的策略
<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
<property name="dataSource" ref="pooledDataSource" />
<property name="transactionManager" ref="transactionManager" />
<property name="databaseSchema" value="roomRent" />
<property name="databaseSchemaUpdate" value="true" />
<property name="asyncExecutorActivate" value="false" />
</bean>
但执行显示并没有起效。网上也没有靠谱的结果。。
只能自己查看源码。databaseSche

在使用SSH和Activiti6的项目中遇到启动时数据库查询异常,表'activiti.act_ge_property'不存在。尽管配置了databaseSchemaUpdate为true以期望Activiti自动创建或更新表,但启动仍报错。问题出在数据库表存在性检查时误找到其他项目中的Activiti表。解决方案是删除多余数据库或手动执行建表脚本。历史和ID表在首次启动未创建,但在后续启动或使用时会自动创建。
最低0.47元/天 解锁文章
452

被折叠的 条评论
为什么被折叠?



