Status: New
Owner: ----

New issue 639 by [email protected]: "ServletScopes.REQUEST already bound" when ServletModule used with Modules.override or PrivateModule
http://code.google.com/p/google-guice/issues/detail?id=639

When ServletModules are combined with PrivateModule or Modules.override (for test code), Injector creation fails with the binding errors below.

Code to reproduce:

Guice.createInjector(new AbstractModule(){
  @Override
  protected void configure() {
    install(new ServletModule());
    install(new PrivateModule() {
      @Override protected void configure() {
        install(new ServletModule());
      }
    });
  }
});

OR

Guice.createInjector(new AbstractModule(){
  @Override
  protected void configure() {
    install(new ServletModule());
    install(Modules.override(new ServletModule()).with());
  }
});



1) Scope ServletScopes.REQUEST is already bound to com.google.inject.servlet.RequestScoped. Cannot bind ServletScopes.REQUEST. at com.google.inject.servlet.InternalServletModule.configure(InternalServletModule.java:77)

2) Scope ServletScopes.SESSION is already bound to com.google.inject.servlet.SessionScoped. Cannot bind ServletScopes.SESSION. at com.google.inject.servlet.InternalServletModule.configure(InternalServletModule.java:78)

3) A binding to javax.servlet.ServletRequest was already configured at com.google.inject.servlet.InternalServletModule.configure(InternalServletModule.java:79). at com.google.inject.servlet.InternalServletModule.configure(InternalServletModule.java:79)

... output snipped ..

--
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.

Reply via email to