So you mean war2 beans are not visible from e.g pages within war2 itself? Check the WELD JIRA if there it's a known issues and file a new one if you can't find any matches, please.
Correct, war2 backing beans are not visible within war2.
I'm unable to lookup a contextual reference for a mypackage2 bean from a class located in mypackage2.
JIRA jbas-8683 looks related but does not explain the problem completly, I'm still searching in JIRA
Downloading jboss6 sources and debugging helped, the problem has to deal with org.jboss.weld.bootstrap.BeanDeployer class.
Using breakpoints in org.jboss.weld.bootstrap.BeanDeployment confirmed that iterator returned by the loadClasses() method is correct.
But, when this collection of classes is added to BeanDeployer, the following code snippet throws an exception (addClass method)
Class<?> clazz = null;
clazz = resourceLoader.classForName(className);
catch (ResourceLoadingException e)
Inspecting beanmanager instance properties showed me that the wrong ResourceLoader is in use.
Surprisingly, the BaseClassLoader of mywebapp1.war is used in a BeanDeployment instance of mywebapp2.war.
Any idea why one classloder is used for loading classes in BeanDeployment.loadClasses() method and another one in BeanDeployer constructor ?