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

相关文章

闲置电脑也能活出第二春?鲁大师AiNAS让你动动手指就能轻松部署

对于大多数人而言,在这个“数据爆炸”的时代或多或少都遇到过存储告急的情况,这使得“存储焦虑”不再是个别现象,而将会是随着软件的不断臃肿而越来越普遍的情况。从不少手机厂商都开始将存储上限提升至1TB可以见得,我们似乎正处在互联网信息飞速增长的阶段,对于存储的需求也将会不断扩大。对于苹果用户而言,这一问题愈发严峻,毕竟512GB和1TB版本的iPhone可不是人人都消费得起的,因此成熟的外置存储方案开

Security OAuth2 单点登录流程

单点登录(英语:Single sign-on,缩写为 SSO),又译为单一签入,一种对于许多相互关连,但是又是各自独立的软件系统,提供访问控制的属性。当拥有这项属性时,当用户登录时,就可以获取所有系统的访问权限,不用对每个单一系统都逐一登录。这项功能通常是以轻型目录访问协议(LDAP)来实现,在服务器上会将用户信息存储到LDAP数据库中。相同的,单一注销(single sign-off)就是指

Spring Security基于数据库验证流程详解

Spring Security 校验流程图 相关解释说明(认真看哦) AbstractAuthenticationProcessingFilter 抽象类 /*** 调用 #requiresAuthentication(HttpServletRequest, HttpServletResponse) 决定是否需要进行验证操作。* 如果需要验证,则会调用 #attemptAuthentica

MySQL数据库宕机,启动不起来,教你一招搞定!

作者介绍:老苏,10余年DBA工作运维经验,擅长Oracle、MySQL、PG、Mongodb数据库运维(如安装迁移,性能优化、故障应急处理等)公众号:老苏畅谈运维欢迎关注本人公众号,更多精彩与您分享。 MySQL数据库宕机,数据页损坏问题,启动不起来,该如何排查和解决,本文将为你说明具体的排查过程。 查看MySQL error日志 查看 MySQL error日志,排查哪个表(表空间

阿里开源语音识别SenseVoiceWindows环境部署

SenseVoice介绍 SenseVoice 专注于高精度多语言语音识别、情感辨识和音频事件检测多语言识别: 采用超过 40 万小时数据训练,支持超过 50 种语言,识别效果上优于 Whisper 模型。富文本识别:具备优秀的情感识别,能够在测试数据上达到和超过目前最佳情感识别模型的效果。支持声音事件检测能力,支持音乐、掌声、笑声、哭声、咳嗽、喷嚏等多种常见人机交互事件进行检测。高效推

C++ | Leetcode C++题解之第393题UTF-8编码验证

题目: 题解: class Solution {public:static const int MASK1 = 1 << 7;static const int MASK2 = (1 << 7) + (1 << 6);bool isValid(int num) {return (num & MASK2) == MASK1;}int getBytes(int num) {if ((num &

Spring 源码解读:自定义实现Bean定义的注册与解析

引言 在Spring框架中,Bean的注册与解析是整个依赖注入流程的核心步骤。通过Bean定义,Spring容器知道如何创建、配置和管理每个Bean实例。本篇文章将通过实现一个简化版的Bean定义注册与解析机制,帮助你理解Spring框架背后的设计逻辑。我们还将对比Spring中的BeanDefinition和BeanDefinitionRegistry,以全面掌握Bean注册和解析的核心原理。

两个月冲刺软考——访问位与修改位的题型(淘汰哪一页);内聚的类型;关于码制的知识点;地址映射的相关内容

1.访问位与修改位的题型(淘汰哪一页) 访问位:为1时表示在内存期间被访问过,为0时表示未被访问;修改位:为1时表示该页面自从被装入内存后被修改过,为0时表示未修改过。 置换页面时,最先置换访问位和修改位为00的,其次是01(没被访问但被修改过)的,之后是10(被访问了但没被修改过),最后是11。 2.内聚的类型 功能内聚:完成一个单一功能,各个部分协同工作,缺一不可。 顺序内聚:

C语言 | Leetcode C语言题解之第393题UTF-8编码验证

题目: 题解: static const int MASK1 = 1 << 7;static const int MASK2 = (1 << 7) + (1 << 6);bool isValid(int num) {return (num & MASK2) == MASK1;}int getBytes(int num) {if ((num & MASK1) == 0) {return

深入理解数据库的 4NF:多值依赖与消除数据异常

在数据库设计中, "范式" 是一个常常被提到的重要概念。许多初学者在学习数据库设计时,经常听到第一范式(1NF)、第二范式(2NF)、第三范式(3NF)以及 BCNF(Boyce-Codd范式)。这些范式都旨在通过消除数据冗余和异常来优化数据库结构。然而,当我们谈到 4NF(第四范式)时,事情变得更加复杂。本文将带你深入了解 多值依赖 和 4NF,帮助你在数据库设计中消除更高级别的异常。 什么是