Click here to Skip to main content
15,887,175 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Using WildFly 29, I followed the quickstart guide for the EJB-Multi-Server at the wildfly quickstart github

Let' s supposes I have two EJB projects A and B
I am already able to call B from A via a JNDI lookup
But when I setup B to be able to call A, I got a maven cyclic dependency error
Because as in the quickstart, we need the dependency of the ejb-client in the pom.xml

What I have tried:

I have already made some research about how to avoid the cyclic dependency but I did not find anything related to EJB and my context
I have also searched for cyclic ejbs, but in my case they are separated projects
Posted

1 solution

If you have two projects called A and B, and A references B while B also references A which do you build first?

If you build A, then B you end up with A being out of date because B has changed. But when you build A, B becomes out of date so that needs rebuilding as well!
If you build B, then A you end up with B being out of date because A has changed. But when you build B, A becomes out of date so that needs rebuilding as well!

That's a cyclic dependency: you cannot build a project because the act of building it affects the projects it is dependent on.
You can't make them call each other: you have to move the dependent code into separate project(s) that do not relay on A or B, and refer to those in both A and B.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900