I am going to use a very simple example to keep this clear. I have an EJB defined, MyEJB. I set it up in IDEA 4.0 as an EJB module. I put the home, local, and bean sources into their own directory, since that's how IDEA seems to want it in 4.0, and designate this source path as a content root.
I set up my main source tree as a Java Module, MyApplication. MyEJB delegates to some utility and process classes in my main source tree to do its work. So I go to the dependency settings for MyEJB, and check MyApplication.
Looks like everything is working right. IDEA correctly identifies the interface-implementation relationship between my home, local, and bean classes, and the bean classes can see the classes in MyApplication that it needs to get to.
EXCEPT... The classes in MyApplication can not see any of the MyEJB classes. Specifically, if any MyApplication classes want a home or local interface for MyEJB, I am out of luck. IDEA will not allow me to identify a dependency in the reverse direction, and IDEA deliberately ignores any attempt to add the MyEJB sources as a content root for MyApplication.
HERE IS WHAT I THINK IS HAPPENING. IDEA 4.0 regards any bidirectional visibility between MyApplication and MyEJB as a circular dependency between modules, and strictly prohibits it. My only options are to break up MyApplication into multiple modules (each with its own source tree since IDEA 4.0 does not allow project modules to share sourcepaths) in such a way as to eliminate all circular dependencies, or to move the MyEJB sources back into the MyApplication module, and disable the J2EE support in IDEA.
I am not going to gripe about how this was not an issue in 3.0. And I am not going to complain about how breaking up the app into modules with no circular dependencies is unfeasible in an app with 80,000 LOC and dozens of EJB. I just want to know whether I have correctly identified what is happening, so that I can stop banging my head on an unsolvable problem.