Reputation: 5235
There’s 2 Singleton instances, both created by Google Guice, in my application.
How’s that even possible?
The binding is done as follow:
bind(Foo.class).to(FooImpl.class).in(Scopes.SINGLETON);
Upvotes: 6
Views: 2545
Reputation: 5235
The problem here was the binding declaration.
We fixed it by replacing the binding declaration to:
bind(FooImpl.class).in(Scopes.SINGLETON);
bind(Foo.class).to(FooImpl.class);
Upvotes: 5