org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl#init

文章详细描述了org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl类中init()方法的作用,涉及数据库配置、事务管理、缓存、事件分发、作业执行器、命令拦截器以及自定义组件的设置,确保Activiti引擎的正确运行。

In the org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl class, the init() method is responsible for initializing the process engine configuration. This method sets up various components and configurations required for the proper functioning of the Activiti process engine.

Here is a high-level overview of what typically happens in the init() method:

  1. Configure Database: The method initializes the database configuration required for Activiti's data persistence. This includes setting up the data source, database schema, and other database-related configurations.

  2. Configure Transaction Management: Activiti operates within a transactional context, and the init() method sets up transaction management for the process engine. It configures transaction managers, isolation levels, and other transaction-related settings.

  3. Configure Caching: Activiti utilizes caching mechanisms to improve performance. The init() method configures cache settings, including cache providers, cache sizes, and cache eviction policies.

  4. Configure Event Dispatching: Activiti provides event listeners to intercept and handle engine events. The init() method configures event listeners and dispatchers for various engine events.

  5. Configure Job Executor: Activiti uses a job executor to handle asynchronous tasks and timers. The init() method configures the job executor, including thread pool settings, job execution intervals, and other related configurations.

  6. Configure Command Interceptors: Activiti employs command interceptors to intercept and customize command execution. The init() method configures command interceptors for executing commands in the process engine.

  7. Configure Custom Components: The init() method may also configure custom components such as custom session factories, session listeners, and other user-defined components.

  8. Start Components: Finally, the init() method starts the initialized components and prepares the process engine for use.

Overall, the init() method in ProcessEngineConfigurationImpl is a crucial part of the process engine's initialization process, where various components and configurations are set up to ensure the proper functioning of the Activiti engine.

Caused by: java.lang.NullPointerException: null 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.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45) 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.spring.SpringProcessEngineConfiguration.buildProcessEngine(SpringProcessEngineConfiguration.java:65) at org.activiti.spring.ProcessEngineFactoryBean.getObject(ProcessEngineFactoryBean.java:57) at org.activiti.spring.ProcessEngineFactoryBean.getObject(ProcessEngineFactoryBean.java:32) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:169) ... 62 common frames omitted Disconnected from the target VM, address: '127.0.0.1:60905', transport: 'socket' Process finished with exit code 1
最新发布
11-28
上述问题,重写了AbstractEngineConfiguration类,在getDefaultDatabaseTypeMappings方法添加了KingbaseES,打包运行后报2025-10-21 10:46:10.986 [main] [WARN] liquibase.database: - Unknown database: KingbaseES 2025-10-21 10:46:11.289 [main] [ERROR] druid.sql.Statement: - {conn-10005, cstmt-20001} execute error. call current_schema com.kingbase8.util.KSQLException: ERROR: syntax error at end of input Position: 20 At Line: 1, Line Position: 20 at com.kingbase8.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:3551) at com.kingbase8.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2993) at com.kingbase8.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:405) at com.kingbase8.jdbc.KbStatement.executeInternal_(KbStatement.java:784) at com.kingbase8.jdbc.KbStatement.execute(KbStatement.java:676) at com.kingbase8.jdbc.KbPreparedStatement.executeWithFlags(KbPreparedStatement.java:286) at com.kingbase8.jdbc.KbCallableStatement.executeWithFlags(KbCallableStatement.java:258) at com.kingbase8.jdbc.KbPreparedStatement.executeQuery(KbPreparedStatement.java:181) at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_executeQuery(FilterChainImpl.java:3241) at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_executeQuery(FilterEventAdapter.java:459) at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_executeQuery(FilterChainImpl.java:3238) at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_executeQuery(FilterEventAdapter.java:459) at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_executeQuery(FilterChainImpl.java:3238) at com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl.executeQuery(PreparedStatementProxyImpl.java:175) at com.alibaba.druid.pool.DruidPooledPreparedStatement.executeQuery(DruidPooledPreparedStatement.java:213) at liquibase.executor.jvm.JdbcExecutor$QueryCallableStatementCallback.doInCallableStatement(JdbcExecutor.java:494) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:118) at liquibase.executor.jvm.JdbcExecutor.query(JdbcExecutor.java:160) at liquibase.executor.jvm.JdbcExecutor.query(JdbcExecutor.java:171) at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:179) at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:194) at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:189) at liquibase.database.AbstractJdbcDatabase.getConnectionSchemaName(AbstractJdbcDatabase.java:365) at liquibase.database.AbstractJdbcDatabase.getDefaultSchemaName(AbstractJdbcDatabase.java:325) at liquibase.changelog.ChangeLogParameters.<init>(ChangeLogParameters.java:61) at liquibase.Liquibase.<init>(Liquibase.java:119) at org.flowable.common.engine.impl.db.LiquibaseBasedSchemaManager.createLiquibaseInstance(LiquibaseBasedSchemaManager.java:189) at org.flowable.common.engine.impl.db.LiquibaseBasedSchemaManager.schemaCheckVersion(LiquibaseBasedSchemaManager.java:140) at liquibase.Scope.lambda$child$0(Scope.java:177) at liquibase.Scope.child(Scope.java:186) at liquibase.Scope.child(Scope.java:176) at liquibase.Scope.child(Scope.java:155) at org.flowable.common.engine.impl.db.LiquibaseBasedSchemaManager.runForLiquibase(LiquibaseBasedSchemaManager.java:93) at org.flowable.common.engine.impl.db.LiquibaseBasedSchemaManager.initSchema(LiquibaseBasedSchemaManager.java:84) at org.flowable.eventregistry.impl.db.EventDbSchemaManager.initSchema(EventDbSchemaManager.java:36) at org.flowable.eventregistry.impl.cmd.SchemaOperationsEventRegistryEngineBuild.execute(SchemaOperationsEventRegistryEngineBuild.java:29) at org.flowable.eventregistry.impl.cmd.SchemaOperationsEventRegistryEngineBuild.execute(SchemaOperationsEventRegistryEngineBuild.java:24) at org.flowable.common.engine.impl.interceptor.DefaultCommandInvoker.execute(DefaultCommandInvoker.java:22) at org.flowable.common.engine.impl.interceptor.TransactionContextInterceptor.execute(TransactionContextInterceptor.java:53) at org.flowable.common.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:105) at org.flowable.common.spring.SpringTransactionInterceptor.lambda$execute$0(SpringTransactionInterceptor.java:57) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) at org.flowable.common.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:57) at org.flowable.common.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30) at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:56) at org.flowable.eventregistry.impl.EventRegistryEngineImpl.<init>(EventRegistryEngineImpl.java:47) at org.flowable.eventregistry.impl.EventRegistryEngineConfiguration.buildEventRegistryEngine(EventRegistryEngineConfiguration.java:208) at org.flowable.eventregistry.spring.SpringEventRegistryEngineConfiguration.buildEventRegistryEngine(SpringEventRegistryEngineConfiguration.java:73) at org.flowable.eventregistry.spring.configurator.SpringEventRegistryConfigurator.initEventRegistryEngine(SpringEventRegistryConfigurator.java:57) at org.flowable.eventregistry.spring.configurator.SpringEventRegistryConfigurator.configure(SpringEventRegistryConfigurator.java:47) at org.flowable.common.engine.impl.AbstractEngineConfiguration.configuratorsAfterInit(AbstractEngineConfiguration.java:1004) at org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl.init(ProcessEngineConfigurationImpl.java:1022) at org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:906) at org.flowable.spring.SpringProcessEngineConfiguration.buildProcessEngine(SpringProcessEngineConfiguration.java:76) at org.flowable.spring.ProcessEngineFactoryBean.getObject(ProcessEngineFactoryBean.java:59) at org.flowable.spring.ProcessEngineFactoryBean.getObject(ProcessEngineFactoryBean.java:32) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:169) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:101) at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1884) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getObjectForBeanInstance(AbstractAutowireCapableBeanFactory.java:1284) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:345) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1389) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1309) at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887) at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:541) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1389) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1309) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:656) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:639) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1431) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1389) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1309) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:656) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:639) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1431) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1389) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1309) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:656) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:639) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1431) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:953) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:740) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:415) at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1312) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) at com.somap.SomapApplication.main(SomapApplication.java:42) 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:498) at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) at org.springframework.boot.loader.Launcher.launch(Launcher.java:108) at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) at org.springframework.boot.loader.PropertiesLauncher.main(PropertiesLauncher.java:467) 2025-10-21 10:46:11.293 [main] liquibase.database: - Error getting default schema liquibase.exception.DatabaseException: Error executing SQL call current_schema: ERROR: syntax error at end of input
10-22
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值