activiti部署流程定义时出错:INSERT INTO ACT_GE_BYTEARRAY,修改数据库编码

本文主要是介绍activiti部署流程定义时出错:INSERT INTO ACT_GE_BYTEARRAY,修改数据库编码,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

 activiti部署流程定义时出错

 1 // 部署流程定义 Deployment deployment = deploymentBuilder.deploy(); 

错误信息:(有乱码的...没留下截图...)

 1 SLF4J: Class path contains multiple SLF4J bindings.
 2 SLF4J: Found binding in [jar:file:/D:/developing/eclipse/workspace/ProjectManagement/projectManagement/src/main/webapp/WEB-INF/lib/slf4j-log4j12-1.7.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]
 3 SLF4J: Found binding in [jar:file:/C:/Users/Administrator/.m2/repository/org/slf4j/slf4j-log4j12/1.7.7/slf4j-log4j12-1.7.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
 4 SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
 5 SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
 6 [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - Loading XML bean definitions from class path resource [spring-activiti.xml]
 7 [org.springframework.context.support.GenericApplicationContext] - Refreshing org.springframework.context.support.GenericApplicationContext@6b09bb57: startup date [Thu Feb 23 13:33:02 CST 2017]; root of context hierarchy
 8 [org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor] - JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
 9 [org.activiti.engine.impl.ProcessEngineImpl] - ProcessEngine default created
10 [org.springframework.test.context.transaction.TransactionalTestExecutionListener] - Began transaction (1) for test context [DefaultTestContext@192d74fb testClass = BpmDefinitionTest, testInstance = org.projMgr.TestCase.BpmDefinitionTest@4bef0fe3, testMethod = deploymentProcessDefinition@BpmDefinitionTest, testException = [null], mergedContextConfiguration = [MergedContextConfiguration@62ea3440 testClass = BpmDefinitionTest, locations = '{classpath:spring-activiti.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]]; transaction manager [org.springframework.jdbc.datasource.DataSourceTransactionManager@27953a83]; rollback [false]
11 [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - Loading XML bean definitions from class path resource [spring-activiti.xml]
12 [org.activiti.engine.impl.ProcessEngineImpl] - ProcessEngine default created
13 [org.activiti.engine.impl.bpmn.deployer.BpmnDeployer] - Processing resource org/projMgr/TestCase/MyProcess.png
14 [org.activiti.engine.impl.bpmn.deployer.BpmnDeployer] - Processing resource org/projMgr/TestCase/MyProcess.bpmn
15 [org.activiti.engine.impl.interceptor.CommandContext] - Error while closing command context
16 org.apache.ibatis.exceptions.PersistenceException: 
17 ### Error updating database.  Cause: java.sql.SQLException: Column count doesn't match value count at row 1
18 ### The error may involve org.activiti.engine.impl.persistence.entity.ResourceEntity.bulkInsertResource-Inline
19 ### The error occurred while setting parameters
20 ### SQL: INSERT INTO ACT_GE_BYTEARRAY(ID_, REV_, NAME_, BYTES_, DEPLOYMENT_ID_, GENERATED_) VALUES                    (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)
21 ### Cause: java.sql.SQLException: Column count doesn't match value count at row 1
22     at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
23     at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:172)
24     at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:157)
25     at org.activiti.engine.impl.db.DbSqlSession.flushBulkInsert(DbSqlSession.java:847)
26     at org.activiti.engine.impl.db.DbSqlSession.flushPersistentObjects(DbSqlSession.java:817)
27     at org.activiti.engine.impl.db.DbSqlSession.flushInserts(DbSqlSession.java:794)
28     at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:615)
29     at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:212)
30     at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:138)
31     at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:66)
32     at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
33     at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)
34     at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)
35     at org.activiti.engine.impl.RepositoryServiceImpl.deploy(RepositoryServiceImpl.java:79)
36     at org.activiti.engine.impl.repository.DeploymentBuilderImpl.deploy(DeploymentBuilderImpl.java:156)
37     at org.projMgr.TestCase.BpmDefinitionTest.deploymentProcessDefinition(BpmDefinitionTest.java:35)
38     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
39     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
40     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
41     at java.lang.reflect.Method.invoke(Unknown Source)
42     at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
43     at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
44     at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
45     at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
46     at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
47     at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83)
48     at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
49     at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:232)
50     at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:89)
51     at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
52     at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
53     at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
54     at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
55     at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
56     at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
57     at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
58     at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
59     at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:175)
60     at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
61     at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
62     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
63     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
64     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
65     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
66 Caused by: java.sql.SQLException: Column count doesn't match value count at row 1
67     at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1084)
68     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4232)
69     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4164)
70     at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2615)
71     at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2776)
72     at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2838)
73     at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2082)
74     at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1307)
75     at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172)
76     at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172)
77     at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:45)
78     at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:73)
79     at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:49)
80     at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:115)
81     at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:75)
82     at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:170)
83     ... 42 more
84 [org.springframework.test.context.transaction.TransactionalTestExecutionListener] - Committed transaction after test execution for test context [DefaultTestContext@192d74fb testClass = BpmDefinitionTest, testInstance = org.projMgr.TestCase.BpmDefinitionTest@4bef0fe3, testMethod = deploymentProcessDefinition@BpmDefinitionTest, testException = org.apache.ibatis.exceptions.PersistenceException: 
85 ### Error updating database.  Cause: java.sql.SQLException: Column count doesn't match value count at row 1
86 ### The error may involve org.activiti.engine.impl.persistence.entity.ResourceEntity.bulkInsertResource-Inline
87 ### The error occurred while setting parameters
88 ### SQL: INSERT INTO ACT_GE_BYTEARRAY(ID_, REV_, NAME_, BYTES_, DEPLOYMENT_ID_, GENERATED_) VALUES                    (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)
89 ### Cause: java.sql.SQLException: Column count doesn't match value count at row 1, mergedContextConfiguration = [MergedContextConfiguration@62ea3440 testClass = BpmDefinitionTest, locations = '{classpath:spring-activiti.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]]
90 [org.springframework.test.context.transaction.TransactionalTestExecutionListener] - Began transaction (2) for test context [DefaultTestContext@192d74fb testClass = BpmDefinitionTest, testInstance = org.projMgr.TestCase.BpmDefinitionTest@733c423e, testMethod = test@BaseTestCase, testException = [null], mergedContextConfiguration = [MergedContextConfiguration@62ea3440 testClass = BpmDefinitionTest, locations = '{classpath:spring-activiti.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]]; transaction manager [org.springframework.jdbc.datasource.DataSourceTransactionManager@27953a83]; rollback [false]
91 通导test
92 [org.springframework.test.context.transaction.TransactionalTestExecutionListener] - Committed transaction after test execution for test context [DefaultTestContext@192d74fb testClass = BpmDefinitionTest, testInstance = org.projMgr.TestCase.BpmDefinitionTest@733c423e, testMethod = test@BaseTestCase, testException = [null], mergedContextConfiguration = [MergedContextConfiguration@62ea3440 testClass = BpmDefinitionTest, locations = '{classpath:spring-activiti.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]]
93 [org.springframework.context.support.GenericApplicationContext] - Closing org.springframework.context.support.GenericApplicationContext@6b09bb57: startup date [Thu Feb 23 13:33:02 CST 2017]; root of context hierarchy

 

主要是

### SQL: INSERT INTO ACT_GE_BYTEARRAY(ID_, REV_, NAME_, BYTES_, DEPLOYMENT_ID_, GENERATED_) VALUES (?, 1, ?, ?, ?, ?) , (?, 1, ?, ?, ?, ?) ### Cause: java.sql.SQLException: Column count doesn't match value count at row 1

 

 

网上查询后,认为是数据库编码的问题。

 查询后发现character_set_server编码是GBK,修改为gb2312后解决问题

查看、修改数据库(MySQL)编码参考:

http://www.2cto.com/database/201310/248493.html

MySQL数据库出现中文乱码的原因,往往是以下以下客户端、服务器、结果集、数据库的字符集不统一造成的,可以通过:

 1 show variables like "%char%"; 

语句查询自己数据库当前字符集的配置。

对于数据库字符集,可以通过这个命令更改:

 1 ALTER DATABASE `db_name` CHARACTER SET utf8; 

其他的也可以通过这条语句修改:

 1 set character_set_client='utf8';  

但是,character_set_server如果默认为latin1,要永久更改,用set命令是行不通的,而更改my.ini文件,也没有效果。

正解是:

在MySQL的安装文件中进入bin目录下,双击MySQLInstanceConfig.exe,重新走一遍server的配置,但需要注意的是,在Character Set环节,要选择第三项,character选择gb2312,(第一项是默认server字符集为latin1)。

修改后查询编码:

activiti流程部署启动:

 

 

 

 

 

 

 

 

 

 

 

 



转载于:https://www.cnblogs.com/sucia-panda/p/6437513.html

这篇关于activiti部署流程定义时出错:INSERT INTO ACT_GE_BYTEARRAY,修改数据库编码的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/685068

相关文章

MySQL数据库双机热备的配置方法详解

《MySQL数据库双机热备的配置方法详解》在企业级应用中,数据库的高可用性和数据的安全性是至关重要的,MySQL作为最流行的开源关系型数据库管理系统之一,提供了多种方式来实现高可用性,其中双机热备(M... 目录1. 环境准备1.1 安装mysql1.2 配置MySQL1.2.1 主服务器配置1.2.2 从

SpringBoot基于注解实现数据库字段回填的完整方案

《SpringBoot基于注解实现数据库字段回填的完整方案》这篇文章主要为大家详细介绍了SpringBoot如何基于注解实现数据库字段回填的相关方法,文中的示例代码讲解详细,感兴趣的小伙伴可以了解... 目录数据库表pom.XMLRelationFieldRelationFieldMapping基础的一些代

Nginx分布式部署流程分析

《Nginx分布式部署流程分析》文章介绍Nginx在分布式部署中的反向代理和负载均衡作用,用于分发请求、减轻服务器压力及解决session共享问题,涵盖配置方法、策略及Java项目应用,并提及分布式事... 目录分布式部署NginxJava中的代理代理分为正向代理和反向代理正向代理反向代理Nginx应用场景

pycharm跑python项目易出错的问题总结

《pycharm跑python项目易出错的问题总结》:本文主要介绍pycharm跑python项目易出错问题的相关资料,当你在PyCharm中运行Python程序时遇到报错,可以按照以下步骤进行排... 1. 一定不要在pycharm终端里面创建环境安装别人的项目子模块等,有可能出现的问题就是你不报错都安装

Spring Boot分层架构详解之从Controller到Service再到Mapper的完整流程(用户管理系统为例)

《SpringBoot分层架构详解之从Controller到Service再到Mapper的完整流程(用户管理系统为例)》本文将以一个实际案例(用户管理系统)为例,详细解析SpringBoot中Co... 目录引言:为什么学习Spring Boot分层架构?第一部分:Spring Boot的整体架构1.1

nodejs打包作为公共包使用的完整流程

《nodejs打包作为公共包使用的完整流程》在Node.js项目中,打包和部署是发布应用的关键步骤,:本文主要介绍nodejs打包作为公共包使用的相关资料,文中通过代码介绍的非常详细,需要的朋友可... 目录前言一、前置准备二、创建与编码三、一键构建四、本地“白嫖”测试(可选)五、发布公共包六、常见踩坑提醒

Ubuntu向多台主机批量传输文件的流程步骤

《Ubuntu向多台主机批量传输文件的流程步骤》:本文主要介绍在Ubuntu中批量传输文件到多台主机的方法,需确保主机互通、用户名密码统一及端口开放,通过安装sshpass工具,准备包含目标主机信... 目录Ubuntu 向多台主机批量传输文件1.安装 sshpass2.准备主机列表文件3.创建一个批处理脚

一个Java的main方法在JVM中的执行流程示例详解

《一个Java的main方法在JVM中的执行流程示例详解》main方法是Java程序的入口点,程序从这里开始执行,:本文主要介绍一个Java的main方法在JVM中执行流程的相关资料,文中通过代码... 目录第一阶段:加载 (Loading)第二阶段:链接 (Linking)第三阶段:初始化 (Initia

使用Node.js和PostgreSQL构建数据库应用

《使用Node.js和PostgreSQL构建数据库应用》PostgreSQL是一个功能强大的开源关系型数据库,而Node.js是构建高效网络应用的理想平台,结合这两个技术,我们可以创建出色的数据驱动... 目录初始化项目与安装依赖建立数据库连接执行CRUD操作查询数据插入数据更新数据删除数据完整示例与最佳

Python动态处理文件编码的完整指南

《Python动态处理文件编码的完整指南》在Python文件处理的高级应用中,我们经常会遇到需要动态处理文件编码的场景,本文将深入探讨Python中动态处理文件编码的技术,有需要的小伙伴可以了解下... 目录引言一、理解python的文件编码体系1.1 Python的IO层次结构1.2 编码问题的常见场景二