EJBs can communicate with each other using RMI/IIOP, and a servlet can use networking APIs to call on any other resource available over the HTTP protocol, so, EJBs and Servlets can certainly interact with EJBs and Servlets packaged in different EARs, or even deployed to different servers.
However, the semantics do differ. War files, even if in the same war, cannot share session data by default. Security contexts don't span multiple ears. Transactional contexts will need rethinking.
Application packaging is both an art and a science. There's much to consider when architecting and packaging an application for deployment.
Oh sure, it's a tiny ad, but under the right circumstances, it gets bigger.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop