I've added this scopes merge to BeanMetaDataDeployer.
KernelControllerContext context = new
AbstractKernelControllerContext(null, deployment, null);
ScopeInfo scopeInfo = context.getScopeInfo();
if (scopeInfo != null)
{
mergeScopes(scopeInfo.getScope(), unit.getScope());
mergeScopes(scopeInfo.getMutableScope(), unit.getMutableScope());
}
try
{
controller.install(context);
}
catch (Throwable t)
{
throw DeploymentException.rethrowAsDeploymentException("Error
deploying: " + deployment.getName(), t);
}
}
/**
* Merge scope keys.
*
* @param contextKey the context key
* @param unitKey the unit key
*/
protected static void mergeScopes(ScopeKey contextKey, ScopeKey unitKey)
{
if (contextKey == null)
return;
if (unitKey == null)
return;
Collection<Scope> unitScopes = unitKey.getScopes();
if (unitScopes == null || unitScopes.isEmpty())
return;
for (Scope scope : unitScopes)
contextKey.addScope(scope);
}
The JBossAS5_trunk now boots fine with all MC snapshots.
My demos also work. :-)
But I haven't closed JBDEPLOY-69 yet.
Any other corner case we can think of?
Ales Justin wrote:
This is cause by:
-
http://fisheye.jboss.org/browse/JBossAS/projects/jboss-deployers/trunk/de...
-
https://jira.jboss.org/jira/browse/JBDEPLOY-69
It messes up the Scopes + MetaDataRetrievals.
So the Pojo IoC annotations are not found.
In this case it's the @Create, @Start, ... on ServiceSupportMBean.
I ported the security example here:
-
http://anonsvn.jboss.org/repos/jbossas/projects/demos/trunk/models/src/ma...
It was failing with the JBDEPLOY-69.
This annotated bean also had problems, not finding the marked constructor:
-
http://anonsvn.jboss.org/repos/jbossas/projects/demos/trunk/models/src/ma...
Removing JBDEPLOY-69 patch, made things work again.
So, JBDEPLOY-69 is now re-opened.
Expecting better tests. :-)