Comment #1 on issue 548 by bestwing: Same Module Mutiple Implementation
Problem
http://code.google.com/p/google-guice/issues/detail?id=548
Sorry, the PlayerModule.java should be
import com.google.inject.Binder;
import com.google.inject.Module;
import com.google.inject.Provides;
import com.google.inject.Binder;
import com.google.inject.Module;
import com.google.inject.Provides;
public class PlayerModule implements Module {
public void configure(Binder binder) {
binder.bind(Player.class).annotatedWith(Good.class).to(Player.class);
binder.bind(Player.class).annotatedWith(Bad.class).to(Player.class);
}
}
And the error is:
Exception in thread "main" com.google.inject.CreationException: Guice
creation errors:
1) No implementation for app.player.Player was bound.
at app.player.PlayerModule.configure(PlayerModule.java:11)
2) No implementation for app.player.Player was bound.
at app.player.PlayerModule.configure(PlayerModule.java:12)
2 errors
at
com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:354)
at
com.google.inject.InjectorBuilder.initializeStatically(InjectorBuilder.java:152)
at com.google.inject.InjectorBuilder.build(InjectorBuilder.java:105)
at com.google.inject.Guice.createInjector(Guice.java:92)
at com.google.inject.Guice.createInjector(Guice.java:69)
at com.google.inject.Guice.createInjector(Guice.java:59)
at app.player.PlayerClient.main(PlayerClient.java:14)
--
You received this message because you are subscribed to the Google Groups
"google-guice-dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-guice-dev?hl=en.