2 Replies Latest reply: May 12, 2010 7:56 AM by Nicklas Karlsson RSS

StackOverflow on circular dependencies

Cloves Almeida Newbie

The following code:


public class Home {

     @Inject Menu menu;
     
}

public class Menu {

     @Inject
     public Menu(Home home) {
          // do something
     }
}



causes a StackOverflowException when deploying. Is this the best way to use circular dependencies?