Activiti 配置Oracle不能自动创建表解决方法

                       

使用配置文件创建工作流表

<bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration">    <!-- 连接数据库配置 -->    <property name="jdbcDriver" value="oracle.jdbc.driver.OracleDriver"></property>    <property name="jdbcUrl" value="jdbc:oracle:thin:@localhost:1521:orcl"></property>    <property name="jdbcUsername" value="activiti"></property>    <property name="jdbcPassword" value="activiti"></property>    <!-- 如果表不存在  自动创建 -->    <property name="databaseSchemaUpdate" value="true"></property></bean>
   
   
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

启动报如下错误:

### The error may exist in org/activiti/db/mapping/entity/Property.xml### The error may involve org.activiti.engine.impl.persistence.entity.PropertyEntity.selectProperty-Inline### The error occurred while setting parameters### SQL: select * from ACT_GE_PROPERTY where NAME_ = ?### Cause: java.sql.SQLException: ORA-00942: 表或视图不存在
   
   
  • 1
  • 2
  • 3
  • 4
  • 5

原因是引擎在创建表之前 isTablePresent() 方法 发现 schema 的值为null,所以需要配置属性

<property name="databaseSchema" value="activiti"></property>
   
   
  • 1

重新启动,成功创建表。再次启动又报错

Caused by: java.sql.SQLException: ORA-00955: 名称已由现有对象使用
   
   
  • 1

将值改为 大写 即可

<property name="databaseSchema" value="ACTIVITI"></property>
   
   
  • 1

作者:itmyhome

           

再分享一下我老师大神的人工智能教程吧。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.csdn.net/jiangjunshow

猜你喜欢

转载自blog.csdn.net/hffygc/article/details/87606334