If I got it right, the following happens during deployment of an ear:
1. the MainDeployer unpacks the ear and iterates over the modules 2. the MainDeployer retrieves an apropriate deployer for each module (e.g. EJBDeployer) and invokes the method "deploy" on it 3. The EJBDeployer creates an Application for its ejb-jar and _starts_ it! 4. The Application initializes, _creates_ and starts a Container for every bean 5. The create Method invokes setupEnvironment 6. during setupEnvironment the ejb-links are resolved getApplication(). So there's one Application per ejb-jar, instead of one Application per ear. That's a problem: If the ear contained two ejb-jars and an ejb from the first jar "ejb-ref"-links an ejb from the second jar, the link cannot be resolved: getApplication().getContainer(ref.getLink()) .. will fail, because the two beans are in different applications. If I'm right, the EJBDeployer should not instantiate a separate Application for each ejb-jar, but share one Application instance per ear-File. If that's not possible, the Applications could be arranged hierarchically. All ejb-jar Applications from one ear have one ear Application as parent. Anyway, there must be a unit, that maps all ejb-names from all modules of an ear to the appropriate Containers. The Application can be started, after all modules of the container are deployed. Holger _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development