问题描述
- jbpm上传打包好的zip文件,然后上传完说发布流程文件失败,求大神解答
-
工具:MyEclipse10.0 jbpm4.4 数据库版本是Mysql5.1下面是jsp页面代码
jsp页面代码
<%@page import="java.util.zip.ZipInputStream"%>
<%@page import="java.io.File"%>
<%@page import="java.io.FileInputStream"%>
<%@page import="java.io.InputStream"%>
<%@page import="org.jbpm.api.RepositoryService"%>
<%@page import="org.jbpm.api.Configuration"%>
<%@page import="org.jbpm.api.ProcessEngine"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
上传
<br>
function readFile(obj) {<br>
document.getElementById("file").value = obj.value;<br>
}<br><% request.setCharacterEncoding("UTF-8");
String deployFile = request.getParameter("processDef");
if (deployFile != null && deployFile != "") {
//必须使用的,流程引擎
ProcessEngine processEngine = Configuration.getProcessEngine();
RepositoryService repositoryService =processEngine.getRepositoryService();
try {
String file = deployFile;
//将ZIP文件封转到IO流里
InputStream is = new FileInputStream(new File(file));
ZipInputStream zis = new ZipInputStream(is);
//将ZIP流程文件发布到pvm(流程虚拟机中,他会把ZIP包中的xml文件和png图片存储到数据库中)
repositoryService.createDeployment().addResourcesFromZipInputStream(zis).deploy();
zis.close();
is.close();
out.println("发布流程成功
");
out.println("返回
");
} catch (Exception e) {
e.printStackTrace();
out.println("发布流程失败");
}
}
%>
可直接发布zip文件????
发布流程文件??要上传的流程文件
xml代码
<?xml version="1.0" encoding="UTF-8"?>上传完失败后,出现下面错误
二月 24, 2016 11:48:26 上午 org.jbpm.internal.log.Jdk14Log debug
详细: ----- beginning hibernate tx 13104183 --------------------------------------------------------
二月 24, 2016 11:48:26 上午 org.hibernate.jdbc.util.SQLStatementLogger logStatement
详细:
select
propertyim0_.KEY_ as KEY1_2_,
propertyim0_.VERSION_ as VERSION2_2_,
propertyim0_.VALUE_ as VALUE3_2_
from
JBPM4_PROPERTY propertyim0_ limit ?
二月 24, 2016 11:48:26 上午 org.hibernate.type.NullableType nullSafeGet
非常详细: returning 'next.dbid' as column: KEY1_2_
二月 24, 2016 11:48:26 上午 org.hibernate.type.NullableType nullSafeGet
非常详细: returning '0' as column: VERSION2_2_
二月 24, 2016 11:48:26 上午 org.hibernate.type.NullableType nullSafeGet
非常详细: returning '1' as column: VALUE3_2_
二月 24, 2016 11:48:26 上午 org.hibernate.jdbc.util.SQLStatementLogger logStatement
详细:
select
propertyim0_.KEY_ as KEY1_2_0_,
propertyim0_.VERSION_ as VERSION2_2_0_,
propertyim0_.VALUE_ as VALUE3_2_0_
from
JBPM4_PROPERTY propertyim0_
where
propertyim0_.KEY_=?
二月 24, 2016 11:48:26 上午 org.hibernate.type.NullableType nullSafeSet
非常详细: binding 'db.version' to parameter: 1
二月 24, 2016 11:48:26 上午 org.jbpm.internal.log.Jdk14Log info
信息: jBPM version info: library[4.4-SNAPSHOT], schema[null]
二月 24, 2016 11:48:26 上午 org.jbpm.internal.log.Jdk14Log debug
详细: ----- committing hibernate tx 3988171 -------------------------------------------------------
java.io.FileNotFoundException: leave.zip (系统找不到指定的文件。)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.(FileInputStream.java:146)
at org.apache.jsp.deploy_jsp._jspService(deploy_jsp.java:105)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:724)
求大神帮忙看看。。。