Guice bindings report

Guice bindings report show all available guice bindings.

     // or printAllGuiceBindings() to see also guicey bindings (from GuiceBootstrapModule) 

Example report:

 1 MODULES with 3 bindings
    └── CasesModule                  (
        ├── <typelistener>                        CustomTypeListener                              at
        ├── <provisionlistener>                   CustomProvisionListener                         at
        ├── <aop>                                 CustomAop                                       at
        ├── untargetted          [@Singleton]     AopedService                                    at *AOP
        ├── linkedkey            [@Prototype]     BindService                                     at *OVERRIDDEN
        └── instance             [@Singleton]     BindService2                                    at *OVERRIDDEN

    1 OVERRIDING MODULES with 2 bindings
    └── OverrideModule               (
        ├── linkedkey            [@Prototype]     BindService                                     at *OVERRIDE
        └── instance             [@Singleton]     BindService2                                    at *OVERRIDE

    1 UNDECLARED bindings
    └── JitService                   (r.v.d.g.d.r.g.s.exts)

    └── BindService  --[linked]-->  OverrideService


If you run application in IDE then binding traces (on the right) should be clickable in console (strange format of "at + full class name" used exactly to activate such links because IDE will consider these lines as stacktrace elements).

Report is build using guice SPI from raw modules and that's why it shows everything that modules configure (listeners, aop)


You may use multiple modules of the same type (e.g. .modules(new MyModule(), new MyModule())) but report will always show each module only once (because it's impossible to know exact instance for binding, only module class).

Report contains 4 sections:

  • Bindings of modules (registered with .modules())
  • Overriding bindings (from modules in .modulesOverride())
  • Undeclared bindings - JIT bindings (not declared in modules, but existing in runtime due to injection request)
  • Binding chains. In most cases it's connection of interface to implementation like bind(MyIface.class).to(MyIFaceImpl.class). Especially useful for binding overrides because show actual chain (with applied override).

Used markers:

  • EXTENSION - recognized extension binding
  • REMOVED- extension or module disabled and binding(s) removed
  • AOP - bean affected by guice AOP
  • OVERRIDDEN (only in modules tree) - binding is overridden with binding from overriding module
  • OVERRIDES (only in overriding modules tree) - binding override something in main modules
  • WEB - indicates modules extending ServletModule
  • PRIVATE - indicates private module

Binding types


All non-binding declarations (listeners, aop handlers) are put into square braces (e.g. `lt;typelistener>)

Name Example
<scope> bindScope(..)
<aop> bindInterceptor(..)
<typelistener> bindListener(..)
<provisionlistener> bindListener(..)
<typeconverter> convertToTypes(..)
<filterkey> filter("/1/*").through(MyFilter.class) (in ServletModule)
<filterinstance> filter("/1/*").through(new MyFilter()) (in ServletModule)
<servletkey> serve("/1/foo").with(MyServlet.class) (in ServletModule)
<servletinstance> serve("/1/foo").with(new MyServlet()) (in ServletModule)
instance bing(Smth.class).toInstance(obj)
providerinstance bind(Smth.class).toProvider(obj)
linkedkey bind(Smth.class).to(Other.class) (Other may be already declared with separate binding)
providerkey bind(Smth.class).toProvider(DmthProv.class)
untargetted bind(Smth.class)
providermethod Module method annotated with @Provides
exposed expose(PrivateService.class) (service expose in PrivateModule)


Multibindings extension bindings are showed as raw bindings. There are no special support to aggregate them (maybe will be added later).

 MultibindingsModule          (    
        ├── linkedkey            [@Prototype]     @Element Plugin (multibinding)                  at
        ├── instance             [@Singleton]     @Element Plugin (multibinding)                  at


Multibinder.newSetBinder(binder(), Plugin.class).addBinding().to(MyPlugin.class)


Report explicitly marks overridden bindings (by overriding modules). For example, in the report above, module binding

├── linkedkey            [@Prototype]     BindService                                     at *OVERRIDDEN

is overridden by

├── linkedkey            [@Prototype]     BindService                                     at *OVERRIDE


Report lines are long so you'll have to scroll report blocks to the right to see markers.


Report shows all beans affected with aop:

├── untargetted          [@Singleton]     AopedService                                    at *AOP


Use AOP report to see what exact handlers were applied and with what order.

Private modules

For private guice modules report will show all internal bindings:

INFO  [2019-10-13 09:21:21,080] ru.vyarus.dropwizard.guice.debug.GuiceBindingsDiagnostic: Guice bindings = 

    4 MODULES with 4 bindings
    └── OuterModule                  (r.v.d.g.d.r.g.s.privt)    
        └── InnerModule                  (r.v.d.g.d.r.g.s.privt)    *PRIVATE
            ├── untargetted          [@Prototype]     InnerService                                    at
            ├── untargetted          [@Prototype]     OuterService                                    at *EXPOSED
            ├── exposed              [@Prototype]     OuterService                                    at
            └── Inner2Module                 (r.v.d.g.d.r.g.s.privt)    
                ├── untargetted          [@Prototype]     InnerService2                                   at
                └── Inner3Module                 (r.v.d.g.d.r.g.s.privt)    *PRIVATE
                    └── untargetted          [@Prototype]     OutServ                                         at *EXPOSED


public class OuterModule extends AbstractModule {
    protected void configure() {
        install(new InnerModule());

public class InnerModule extends PrivateModule {
    protected void configure() {
        install(new Inner2Module());


public class Inner2Module extends AbstractModule {
    protected void configure() {
        install(new Inner3Module());

public class Inner3Module extends PrivateModule {

    protected void configure() {


Exposed service from inner private module expose(OutServ.class); is not shown in report! It is hidden intentionally to clarify which bindings are visible by application (only exposed bindings after the top-most private module).

Removed bindings

For recognized extensions and transitive modules guicey can apply disable rules: so when you disable extension (.disableExtensions) or guice module (.disableModules) it will physically remove relative bindings. All removed are indicated on report.

For example:

INFO  [2019-10-13 09:26:59,502] ru.vyarus.dropwizard.guice.debug.GuiceBindingsDiagnostic: Guice bindings = 

    2 MODULES with 2 bindings
    └── TransitiveModule             (    
        ├── untargetted          [@Prototype]     Res1                                            at *EXTENSION
        ├── untargetted          [@Prototype]     Res2                                            at *EXTENSION, REMOVED
        └── Inner                        (r.v.d.g.d.r.g.s.TransitiveModule) *REMOVED


public class TransitiveModule extends AbstractModule {

    protected void configure() {
        install(new Inner());

    public static class Inner extends AbstractModule {
        protected void configure() {

        .modules(new TransitiveModule())

Report customization

Report is implemented as guicey event listener and provide additional customization options, so if default configuration (from shortcut methods above) does not fit your needs you can register listener directly with required configuration.

For example, guice bindings report without library bindings is configured like this:

listen(new GuiceBindingsDiagnostic(new GuiceConfig()

Report rendering logic may also be used directly as report provide separate renderer object implementing ReportRenderer. Renderer not bound to guice context and assume direct instantiation.

For examples of direct renderer usage see events implementation:

  • InjectorPhaseEvent.ReportRenderer