[jBPM Development] - DeploymentAdaptor: duplicated process deployment since commi
by SNy
Hey,
I've found a problem with the JBoss deployment code in jBPM4.
It has been introduced in commit 4753 which added forms support via freemarker .ftl template files.
A change was made in the DeploymentAdaptor's deploy() method to add all resources from the given zip input stream (instead of just the specified process descriptor .jpdl.xml given in the DeploymentMetaData).
| Index: DeploymentAdaptor.java
| ===================================================================
| --- DeploymentAdaptor.java (revision 4752)
| +++ DeploymentAdaptor.java (revision 4753)
| @@ -23,6 +23,7 @@
|
| import java.io.File;
| import java.util.List;
| +import java.util.zip.ZipInputStream;
|
| import javax.naming.InitialContext;
| import javax.transaction.SystemException;
| @@ -59,7 +60,8 @@
| File deploymentFile = new File(deploymentName);
|
| long deploymentDbid = repositoryService.createDeployment()
| - .addResourceFromUrl(deploymentMetData.getProcessDescriptor())
| + .addResourcesFromZipInputStream(new ZipInputStream(deploymentMetData.getWatch().openStream()))
| + //.addResourceFromUrl(deploymentMetData.getProcessDescriptor())
| .setTimestamp(deploymentFile.lastModified())
| .setName(deploymentName)
| .deploy();
|
This was apparently done to add the .ftl templates to the deployment but has the (IMHO unintended) consequence of also adding ALL processes from the archive.
In combination with the way the .bar is deployed in JBoss, this results in multiple deployments (DeploymentAdaptor called n times for n process descriptors in the .bar) each including all the processes (ie: a .bar with 4 .jpdl.xml files will result in 4 deployments each including all 4 processes).
Also, I found the deployer to not really consider the timestamp of the .bar. When starting/stopping the server, it will undeploy the processes (which suspends them as indicated in jira issue JBPM-2242) but instead of reactivating them it will redeploy them which then results in another n deployments.
I know, two issues in one post, but they are kind of related.
Regards,
Marko
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4252069#4252069
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4252069
15 years, 4 months
[JBoss OSGi Development] - Added proper handling of framework properties
by thomas.diesler@jboss.com
Framework properties can now be configured on the OSGiBundleManager
| <bean name="OSGiBundleManager" class="org.jboss.osgi.plugins.facade.bundle.OSGiBundleManager">
| <constructor><parameter><inject bean="MainDeployer" /></parameter></constructor>
| <property name="properties">
| <map keyClass="java.lang.String" valueClass="java.lang.String">
| <entry><key>org.osgi.framework.storage</key><value>${log4j.output.dir}/osgi-store</value></entry>
| <entry><key>org.osgi.framework.storage.clean</key><value>onFirstInit</value></entry>
| <entry><key>org.osgi.framework.system.packages.extra</key><value>
| org.jboss.logging;version=2.0,
| org.jboss.osgi.spi.logging;version=1.0,
| org.jboss.osgi.spi.management;version=1.0,
| org.jboss.osgi.spi.service;version=1.0,
| org.jboss.osgi.spi.util;version=1.0
| </value></entry>
| </map>
| </property>
| <incallback method="addPlugin" />
| <uncallback method="removePlugin" />
| </bean>
|
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4252022#4252022
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4252022
15 years, 4 months