在jbpm中将定义好的流程打包后发布到 mysql 中时,会出现如下错误,但是发布到hsqldb没有任何问题 希望得到各位的帮助。
00:04:01,976 [main] WARN JDBCExceptionReporter : SQL Error: 1064, SQLState: 42000
00:04:01,976 [main] ERROR JDBCExceptionReporter : Syntax error or access violation message from server: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?]笎c尗n?0kk&3M\0X(\0(\0(\0(\0(\0(\0(\0(\0(\0(\0(\0(' at line 1"
00:04:01,980 [main] ERROR DbPersistenceService : hibernate commit failed
org.hibernate.exception.SQLGrammarException: could not insert collection: [org.jbpm.bytes.ByteArray.byteBlocks#10]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.persister.collection.AbstractCollectionPersister.recreate(AbstractCollectionPersister.java:1183)
at org.hibernate.action.CollectionRecreateAction.execute(CollectionRecreateAction.java:26)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:143)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at org.jbpm.persistence.db.DbPersistenceService.commit(DbPersistenceService.java:256)
at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:214)
at org.jbpm.svc.Services.close(Services.java:225)
at org.jbpm.JbpmContext.close(JbpmContext.java:139)
at com.helloworld.JbpmTestToDB.main(JbpmTestToDB.java:27)
Caused by: java.sql.BatchUpdateException: Syntax error or access violation message from server: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?]笎c尗n?0kk&3M\0X(\0(\0(\0(\0(\0(\0(\0(\0(\0(\0(\0(' at line 1"
at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1492)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.BatchingBatcher.addToBatch(BatchingBatcher.java:34)
at org.hibernate.persister.collection.AbstractCollectionPersister.recreate(AbstractCollectionPersister.java:1146)
... 14 more
00:04:02,015 [main] ERROR Services : problem closing service 'persistence'
org.jbpm.persistence.JbpmPersistenceException: hibernate commit failed
at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:219)
at org.jbpm.svc.Services.close(Services.java:225)
at org.jbpm.JbpmContext.close(JbpmContext.java:139)
at com.helloworld.JbpmTestToDB.main(JbpmTestToDB.java:27)
Caused by: org.hibernate.exception.SQLGrammarException: could not insert collection: [org.jbpm.bytes.ByteArray.byteBlocks#10]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.persister.collection.AbstractCollectionPersister.recreate(AbstractCollectionPersister.java:1183)
at org.hibernate.action.CollectionRecreateAction.execute(CollectionRecreateAction.java:26)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:143)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at org.jbpm.persistence.db.DbPersistenceService.commit(DbPersistenceService.java:256)
at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:214)
... 3 more
Caused by: java.sql.BatchUpdateException: Syntax error or access violation message from server: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?]笎c尗n?0kk&3M\0X(\0(\0(\0(\0(\0(\0(\0(\0(\0(\0(\0(' at line 1"
at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1492)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.BatchingBatcher.addToBatch(BatchingBatcher.java:34)
at org.hibernate.persister.collection.AbstractCollectionPersister.recreate(AbstractCollectionPersister.java:1146)
... 14 more
代码如下:
JbpmConfiguration configuration = JbpmConfiguration.getInstance();
JbpmContext context = configuration.createJbpmContext();
String fileString = "F:\\helloworld.zip";
try {
FileInputStream in = new FileInputStream(new File(fileString));
ZipInputStream z = new ZipInputStream(in);
ProcessDefinition definition = ProcessDefinition.parseParZipInputStream(z);
context.deployProcessDefinition(definition);
z.close();
in.close();
} catch (Exception e) {
// TODO: handle exception
}
finally{
context.close();
}