[jboss-jira] [JBoss JIRA] Closed: (JBMICROCONT-159) Multiple components
Adrian Brock (JIRA)
jira-events at lists.jboss.org
Tue Sep 18 10:17:11 EDT 2007
[ http://jira.jboss.com/jira/browse/JBMICROCONT-159?page=all ]
Adrian Brock closed JBMICROCONT-159.
------------------------------------
Fix Version/s: JBossMC-2.0.0.Beta4
Resolution: Done
This issue was resolved as part of the latest revs of the deployers
<testsuite errors="0" skipped="0" tests="1" time="0.026" failures="0" name="org.jboss.test.deployers.deployer.test.MultipleComponentTypeUnitTestCase">
> Multiple components
> --------------------
>
> Key: JBMICROCONT-159
> URL: http://jira.jboss.com/jira/browse/JBMICROCONT-159
> Project: JBoss MicroContainer
> Issue Type: Bug
> Components: Deployment
> Affects Versions: JBossMC_2_0_0 Beta3
> Reporter: Scott M Stark
> Assigned To: Adrian Brock
> Fix For: JBossMC-2.0.0.Beta4
>
>
> There is a problem with how component deployments are handled. When a DeploymentUnit contains multiple sources of component metadata (a jar with a META-INF/*-beans.xml,*-service.xml for example), duplicate processing of components is occuring. This is due to the AbstractComponentDeployer.deployComponents query for the component metadata:
> protected void deployComponents(DeploymentUnit unit) throws DeploymentException
> {
> if (compVisitor == null)
> return;
> Set<? extends C> components = unit.getAllMetaData(componentType);
> for (C component : components)
> compVisitor.deploy(unit, component);
> }
> The DeploymentUnit.getAllMetaData(componentType) for the current DeploymentComponentContext looks to its parent for metadata. This combined with the recursive processing in the MainDeployerImpl.commitDeploy:
> private void commitDeploy(Deployer deployer, DeploymentContext context, Set<DeploymentContext> components)
> throws DeploymentException
> {
> DeploymentContext[] theComponents = null;
> if (components != null && components.isEmpty() == false)
> theComponents = components.toArray(new DeploymentContext[components.size()]);
>
> DeploymentUnit unit = context.getDeploymentUnit();
> deployer.commitDeploy(unit);
> try
> {
> if (theComponents != null)
> {
> for (int i = 0; i < theComponents.length; ++i)
> {
> try
> {
> Set<DeploymentContext> componentComponents = theComponents[i].getComponents();
> commitDeploy(deployer, theComponents[i], componentComponents);
> }
> catch (DeploymentException e)
> {
> // Unwind the previous components
> for (int j = i-1; j >=0; --j)
> prepareUndeploy(deployer, theComponents[j], true);
> throw e;
> }
> }
> }
> }
> catch (DeploymentException e)
> {
> prepareUndeploy(deployer, context, false);
> throw e;
> }
> }
> Results in a structure like:
> DU(some.jar)
> + CDC(Bean1)
> + CDC(ServiceBean2)
> + CDC(Bean2)
> + CDC(ServiceBean2)
> + CDC(ServiceBean1)
> + CDC(ServiceBean2)
> + CDC(ServiceBean2)
> The service deployer components are being recursively added to the kernel components and duplicate install errors result.
> See the org.jboss.test.deployers.deployer.test.MultipleComponentTypeUnitTestCase
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list