Open GoogleCodeExporter opened 9 years ago
(Using Guice version 2.0)
Original comment by ron.gr...@gmail.com
on 7 Oct 2010 at 9:47
A few workarounds that I've found:
1. Using a Provider instead of Guice's Proxy seems to resolve the issue.
2. When using asEagerSingleton the problem does not reproduce.
Is there a way to disable the proxy generation for circular dependencies (make
it thorw an exception)? I would rather always use a Provider instead of a proxy
until this is fixed, and would like an easy way to catch all these cases where
my code has circular dependencies.
Original comment by ron.gr...@gmail.com
on 7 Oct 2010 at 9:56
Also - the problem does not reproduce if I don't bind the objects as singletons.
Original comment by ron.gr...@gmail.com
on 7 Oct 2010 at 11:51
Re: Is there a way to disable the proxy generation for circular dependencies
(make it throw an exception)?
Yes, but it requires Guice 3.0 (or more specifically, the code in SVN since 3.0
is not released yet). Use InjectorBuilder.disableCircularProxies.
Original comment by sberlin
on 7 Oct 2010 at 12:21
I actually tried that, but I see that some tests are failing in trunk, and also
had problems compiling my code against Guice 3.0. For now I resorted to making
the classes non-singletons.
Original comment by ron.gr...@gmail.com
on 7 Oct 2010 at 1:05
The AllTests target suppresses some tests that are known to fail (they're
written against expectations that Guice doesn't fulfill yet).
What issues are you seeing compiling against 3.0? It should be a trivial swap.
Original comment by sberlin
on 7 Oct 2010 at 1:43
Original issue reported on code.google.com by
ron.gr...@gmail.com
on 7 Oct 2010 at 9:44Attachments: