vwjugow

cyclic dependencies

Mar 24th, 2014
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. Our last hypothesis was that having cyclic dependencies was the reason for the exception. We have not completely discarded this yet. We added a cyclic dependency in the archetype project, and we got the same exception, but not exaclty: http://pastebin.com/FP70Bd4Q
  2. If you look closely when having cyclic dependency the stack trace shows:
  3. while locating ar.com.client.shared.DummyService
  4. for field at ar.com.server.SimpleCDIService.dummyService(SimpleCDIService.java:16)
  5. while locating ar.com.server.SimpleCDIService
  6. for field at ar.com.server.DummyServiceImpl.cdiService(DummyServiceImpl.java:13)
  7. while locating ar.com.server.DummyServiceImpl
  8.  
  9. You can really see the cycle here DummyService, SimpleCDIService and DummyServiceImpl again. But in our case it’s not like that
  10. while locating app.server.helper.RuleHelper
  11. for field at app.server.service.EnabledStrategiesImpl.ruleHelper(EnabledStrategiesImpl.java:22)
  12. while locating app.server.service.EnabledStrategiesImpl
  13.  
  14. In our case there is no cycle.
  15. Anyhow, we tried removing some cycles and it didn’t work, so it doesn’t seem to be the problem.
  16.  
  17. UPDATE:
  18. I created a dependency cycle of 3 classes in the archetype and the error is the same.
  19. DummyService
  20. DummyService2
  21. SimpleCDIService
  22. DummyService
  23. the error is:
  24. com.google.inject.ConfigurationException: Guice configuration errors:
  25.  
  26. 1) No implementation for ar.com.client.shared.DummyService2 was bound.
  27. while locating ar.com.client.shared.DummyService2
  28. for field at ar.com.server.DummyServiceImpl.dummyService2(DummyServiceImpl.java:14)
  29. while locating ar.com.server.DummyServiceImpl
  30.  
  31. So I went to look again in appui for cycles and I found one of 5 classes. Unfortunately when I removed it same error happened.
  32. Here is the cycle: http://pastebin.com/4yv3TAdt
  33. I looked for more cycles related to the 2 exception classes but couldn’t find any.
Advertisement
Add Comment
Please, Sign In to add comment