问题描述:最近在学JBPM,在页面上传一个zip格式文件,利用 org.jbpm.api.NewDeployment.addResourcesFromZipInputStream(ZipInputStream arg0)这个方法解析的时候就会报错。我是跟着视频学的,我直接拷视频的源码也报错。我怀疑是编码问题,因为报错信息最下面出现乱码。可我所有地方项目工程和,JSP页面,数据库都统一为U8编码。这个问题卡我两天了!!求大神解救啊!!不甚感激!!!!!
JAVA代码:
zipInputStream = new ZipInputStream(new FileInputStream(zipFile));
processEngine.getRepositoryService() // processEngine是 org.jbpm.api.ProcessEngine
.createDeployment() // 这个方法是org.jbpm.api.RepositoryService.createDeployment,
.addResourcesFromZipInputStream(zipInputStream) // 这个是org.jbpm.api.NewDeployment.deploy 就在这里报错
.deploy();
报错信息:org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update
Caused by: java.sql.BatchUpdateException: 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 '\0\0?E?E\0\0N?E\0\0N?E\0\0N?E\0\0N?E\0\0N?E\0\0N?E\0\0N?E\0\0N?E\0\0N?E\0\0N?E\0' at line 1
at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1669)
at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1085)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268)
... 116 m
上传的文件:
<?xml version="1.0" encoding="UTF-8"?>
还有一张PNG格式的图片