Jbpm系统找不到指定文件

chengxiaohu66 2013-04-16

不知道有没有人做过这个例子.上传一个leave.zip压缩包。

我写了这个例子后,出现了以下错误:

----- committing hibernate tx 4267644 -------------------------------------------------------
java.io.FileNotFoundException: leave.zip (系统找不到指定的文件。)
	at java.io.FileInputStream.open(Native Method)
	at java.io.FileInputStream.<init>(FileInputStream.java:106)
	at org.apache.jsp.deploy_jsp._jspService(deploy_jsp.java:80)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
	at java.lang.Thread.run(Thread.java:619)
 

 请问哪位高手能帮忙解决.

 

chengxiaohu66 2013-04-16
<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@page
	import="java.io.File,java.io.FileInputStream,java.io.InputStream,java.util.zip.ZipInputStream,java.util.*,org.jbpm.api.*,java.util.zip.*"%>
<%@page import="org.w3c.dom.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Insert title here</title>
</head>
<body>
<%
	request.setCharacterEncoding("UTF-8");
	response.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("发布流程成功<br/>");
			out.println("<a href='task-write.jsp'>返回</a><br/>");
		 }catch (Exception e){
			e.printStackTrace();
			out.println("发布流程失败");
		}
	}
%>
<script type="text/javascript">
	function readFile(obj) {
		document.getElementById("file").value = obj.value;
	}
</script>
<font color="red">可直接发布zip文件</font><br/>
<form name="form1" method="post" action="deploy.jsp"><label>
发布流程文件 <input type="file" name="processDef" onchange="readFile(this)">
</label>
<label>
<input type="submit" name="Submit" value="提交">
</label>
</form>
</body>
</html>

这个是源码
forevercoding 2013-04-17
此类问题,楼主自己动手调试解决
Global site tag (gtag.js) - Google Analytics