0
import com.google.inject.assistedinject.Assisted;

public interface TesterFactory {
    TesterResource create(@Assisted String serviceName, @Assisted String serviceType);
}

My TesterResource class has 2 members:

@Inject
@Assisted
private String serviceName;

@Inject
@Assisted
private String serviceType;

However when I build the code I get an error A binding to java.lang.String annotated with @com.google.inject.assistedinject.Assisted(value=) was already configured at TesterFactory.create(). If I keep @Assisted only for serviceName, I do not get this error.

user1692342
  • 5,007
  • 11
  • 69
  • 128
  • Answered here: http://stackoverflow.com/questions/29824177/guice-assistedinject-already-configured – Di Zou Dec 09 '16 at 19:55

1 Answers1

0

Assisted give you the ability to name the value, @Assisted(value="blah")

Right now (whatever is looking for the injection) is looking for an empty string. As you have it, you are assigning to values (serviceName and serviceType) to an empty value, so you are trying to assign different values to the same binding.

Marian Nasry
  • 821
  • 9
  • 22
snow
  • 1