Activiti of act_ge_property table caused by pit (dbSchemaUpdate)

Activiti of act_ge_property table caused by pit (dbSchemaUpdate)

Reference documents:

https://blog.csdn.net/lb19921223/article/details/79213851

 

He wrote the last article, I learned acitiviti when truncate mysql use of the data in the table are deleted, and then re-deployment process, the results actually being given.

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans   http://www.springframework.org/schema/beans/spring-beans.xsd">

    <!-- 流程引擎配置的bean -->
    <bean id="processEngineConfiguration"
        class="org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration">
        <property name="jdbcUrl"
            value="jdbc:mysql://localhost:3306/db_activiti?serverTimezone=Asia/Shanghai" />
        <property name="jdbcDriver" value="com.mysql.cj.jdbc.Driver" />
        <property name="jdbcUsername" value="root" />
        <property name="jdbcPassword" value="123456" />
        <property name="databaseSchemaUpdate" value="true" />
    </bean>

</beans>

 

 

 

 

package com.yuanqiao.first_activiti.deployment;

import java.util.List;

import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.repository.Deployment;
import org.activiti.engine.repository.DeploymentBuilder;
import org.activiti.engine.repository.ProcessDefinition;
import org.junit.Test;

import com.google.gson.Gson;

/**
 * 通过读取bpmn文件,来部署流程图
 * 
 * @author yuanqiao
 *
 */
public class DeploymentProcess {

	@Test
	public void deploymentFirstProcess() {
		ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();

		RepositoryService repositoryService = processEngine.getRepositoryService();

		DeploymentBuilder deploymentBuilder = repositoryService.createDeployment().addClasspathResource("first.bpmn");

		Deployment deployment = deploymentBuilder.deploy();
		String deploymentId = deployment.getId();
		System.out.println(deploymentId);
		List<ProcessDefinition> processDefinitionList = repositoryService.createProcessDefinitionQuery()
				.deploymentId(deploymentId).list();
		Gson gson = new Gson();
		System.out.println(gson.toJson(processDefinitionList));

	}
}

  

 

 

java.lang.NullPointerException
at org.activiti.engine.impl.db.DbSqlSession.dbSchemaUpdate(DbSqlSession.java:911)
at org.activiti.engine.impl.db.DbSqlSession.performSchemaOperationsProcessEngineBuild(DbSqlSession.java:1318)
at org.activiti.engine.impl.SchemaOperationsProcessEngineBuild.execute(SchemaOperationsProcessEngineBuild.java:28)
at org.activiti.engine.impl.interceptor.CommandInvoker$1.run(CommandInvoker.java:37)
at org.activiti.engine.impl.interceptor.CommandInvoker.executeOperation(CommandInvoker.java:78)
at org.activiti.engine.impl.interceptor.CommandInvoker.executeOperations(CommandInvoker.java:57)
at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:42)
at org.activiti.engine.impl.interceptor.TransactionContextInterceptor.execute(TransactionContextInterceptor.java:48)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:63)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:29)
at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:44)
at org.activiti.engine.impl.ProcessEngineImpl.<init>(ProcessEngineImpl.java:81)
at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:665)
at org.activiti.engine.ProcessEngines.buildProcessEngine(ProcessEngines.java:189)
at org.activiti.engine.ProcessEngines.initProcessEngineFromResource(ProcessEngines.java:162)
at org.activiti.engine.ProcessEngines.init(ProcessEngines.java:94)
at org.activiti.engine.ProcessEngines.getProcessEngine(ProcessEngines.java:223)
at org.activiti.engine.ProcessEngines.getDefaultProcessEngine(ProcessEngines.java:212)
at com.yuanqiao.first_activiti.deployment.DeploymentProcess.deploymentFirstProcess(DeploymentProcess.java:25)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)

 

 

Solution is as follows:

Recent customer to deploy the system, used in the system Activiti process engine, start Tomcat life and death error, error information such as the top. Really confused, thought it was the beginning of the program itself or the server environment (because the environment is newly installed), I did not want to go on the process engine.

The most crucial anomaly just taken the top, in fact, before that also reported an anomaly, the environment and the program is configured to check a stool, still to no avail, and ultimately to focus on the org.activiti.engine.impl.db .DbSqlSession.dbSchemaUpdate, meaning that abnormal flow table appears in the updated table structure when, how will always update it? Viewed Activiti configuration as FIG.

 databaseSchemaUpdate settings If no table is automatically created as a true representative of the table; it is estimated that the cause here, I re-build an empty database test1, test1 and then connect to the database program, start tomcat, turned out to be a success. Successful heart of stone off the ground.

But still feel very strange, I do not know what the real reason is an afterthought, act_ge_property table, which is the process engine attribute table, which is the basis of the data of three data, can not be deleted. And I looked at the database initialization sql, there is not even the three data, I suddenly realized I was ready package when, in order not to flow inside the data brought over, I just export the table structure, no export data. That is restored to the database server when, act_ge_property table inside There is not data, which resulted in the current problem. Anti-wise to be mistaken smart. . After warning it.

Summary: When ready to deploy database initialization sql, flow charts for the future do not lead out, only export business table, process table so that when the system starts to generate their own.

 

Guess you like

Origin www.cnblogs.com/mkl34367803/p/11570111.html