Guice ThrowingProvider problem

Posted by KARASZI István on Stack Overflow See other posts from Stack Overflow or by KARASZI István
Published on 2011-01-12T13:50:03Z Indexed on 2011/01/12 13:54 UTC
Read the original article Hit count: 220

Filed under:
|
|
|

According to the ThrowingProvider documentation of Guice I have the following interface:

public interface IConfigurableProvider<T> extends ThrowingProvider<T, ConfigException> {}

I have multiple classes that implements this interface, let assume I have the following:

public class SomethingProvider extends ConfiguredProvider implements IConfigurableProvider<Something> {}

Of course this class implements the necessary method:

public Something get() throws ConfigException { /* ... */ }

In my module, I have the following code in MyModule.java

ThrowingProviderBinder.create(binder())
    .bind(IConfigurableProvider.class, Something.class)
    .to(SomethingProvider.class);

But when I start my application the following error produced:

6) No implementation for com.package.Something was bound.
  while locating com.package.Something
    for parameter 5 at com.package.OtherClass.<init>(OtherClass.java:78)
  at com.package.MyModule.configure(MyModule.java:106)

I don't really know where should I start looking for the bug.

© Stack Overflow or respective owner

Related posts about java

Related posts about guice