EJB Module Paths in 4.0

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.

Thanks,
Corby

7 comments

You are right, circular dependencies are not allowed.
Possible solutions can be:
- to have the only EJB module containing EJB classes and utility classes, if there are no other dependencies on these utility
classes.
- factor your Java utility module to eliminate circular dependencies, as you have suggested.

--
regards,
Alexey Kudravtsev
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


"Corby" <no_mail@jetbrains.com> wrote in message news:16015323.1077826776337.JavaMail.javamailuser@localhost...

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.
>

Thanks,
Corby



0

Thank you very much for your clear response. I have disabled J2EE support since my dependencies are too complex to be factored per IDEA's needs.

My understanding is that these new restrictions on circular dependencies have been placed in order to support the more powerful build operations in IDEA 4.0.

Since I personally use Ant rather than the IDEA Build system, I would rather have the circular dependencies than the build support.

So I guess my feature request for a future version would be for a user to have the option to disable the IDEA build support, re-enabling circular dependencies (and in my case, re-enabling J2EE support).

Thanks,
Corby

0

i absolutely agree. it seems that all the work put into idea 4 is totally wasted by this "feature" - idea 4 may have many improvements, but taking away j2ee support (which it effectively does, noone is going to redesign a 400-class projects for those programmers using idea 4) makes this release totally worthless :( there seems to bo no choice but sticking to good old idea 3 :(

0

I agree as well. I don't understand why this restriction has been put in place. There is no way to re-design my project's source code layout just to conform to idea's rules as we have other developers that use other IDE's.

I think idea is a fantastic IDE and I am much more productive with it than other IDE's, but I now cannot use EJB support. Has a RFE been raised for this?

0

It looks like the easiest suggestion for addressing this problem (and re-enabling EJB support) can be found here:

http://www.intellij.net/tracker/idea/viewSCR?publicId=28384

If this problem is affecting you, please vote for this feature request.

Thanks,
Corby

0

This is killing me, guys!

Please bring back IDEA 3.0's glorious EJB support!

0

idea people reading this, could you at least comment on this in any way?

suggested answers:

a) we are working on allowing users to choose either idea3 style j2ee support or idea4 style

b) we are working on allowing users to have j2ee support that does not enforce a very particular directory layout

c) if the users are unwilling to refactor all of their projects then it's not our problem, they can use eclipse or whatever instead. we only care about companies in which everyone uses idea, projects with individual programers on idea (situation where global major refactors are not possible) are not a big enough market for us.

thanks in advance

0

Please sign in to leave a comment.