[
https://jira.jboss.org/jira/browse/JBPM-2127?page=com.atlassian.jira.plug...
]
Tom Baeyens resolved JBPM-2127.
-------------------------------
Fix Version/s: (was: jBPM 4.0.0.Beta1)
Resolution: Out of Date
deployment was refactored in this iteration.
but to be sure, i added following test to the test suite:
public void testLoadProcessAsResource() {
ClassLoader classLoader = DeploymentResourcesTest.class.getClassLoader();
InputStream inputStream =
classLoader.getResourceAsStream("org/jbpm/test/process/process.jpdl.xml");
assertNotNull(inputStream);
long deploymentDbid =
repositoryService.createDeployment()
.addResourceFromInputStream("process.jpdl.xml", inputStream)
.deploy();
registerDeployment(deploymentDbid);
ProcessDefinition processDefinition =
repositoryService.createProcessDefinitionQuery()
.key("Resource")
.uniqueResult();
assertNotNull(processDefinition);
}
and this test runs fine. so i assume your issue is obsolete.
Can't use addInputStream() to deploy a process
----------------------------------------------
Key: JBPM-2127
URL:
https://jira.jboss.org/jira/browse/JBPM-2127
Project: JBoss jBPM
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: PVM
Affects Versions: jBPM 4.0.0 Alpha2
Environment: winxp
Reporter: Xu Huisheng
Assignee: Tom Baeyens
The following codes will cause an Exception, that inputStream is already closed:
List<ProcessDefinition> processDefinitions = processService.createDeployment()
.addInputStream("process.jpdl.xml",
this.getClass().getResourceAsStream("/process.jpdl.xml"))
.deploy()
.getProcessDefinitions();
The exception info is like this:
Caused by: java.io.IOException: Stream closed
at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:14)
at java.io.BufferedInputStream.read(BufferedInputStream.java:308)
at java.io.FilterInputStream.read(FilterInputStream.java:90)
at org.jbpm.pvm.internal.util.IoUtil.transfer(IoUtil.java:55)
If I use addResource() instead of addInputStream(), then the deployment will success.
I read the code of jBPM-4.0.0.Alpha2 and find the execute() method of
org.jbpm.pvm.internal.xml.Parser always close the inputstream after parse it. But on next
step of deploy, the SaveDeploy should read attachment bytes from the inputstream. Then the
Exception occured.
I find the openStream() of org.jbpm.pvm.internal.stream.InputStreamInput always return
the same inputStream, however the openStream() of
org.jbpm.pvm.internal.stream.ResourceStreamInput will create a new inputstream every time,
so it won't cause the problem.
I think this is may be the reason.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira