I have a constructor that looks like this:
@Inject
public MyClass(
@Named("config") String configFile,
@Named("template") String templateFile,
CachedSettings settings,
@Assisted String channelId,
@Nullable @Assisted("NetworkA") NetworkInterface localNetworkInterfaceA,
@Nullable @Assisted("NetworkB") NetworkInterface localNetworkInterfaceB) {
And I get the following error (twice, once for each parameter)
1) null returned by binding at my.company.package.MyClassFactory.create()
but parameter 4 of my.company.package.MyClass.<init>() is not @Nullable
while locating java.net.NetworkInterface annotated with @com.google.inject.assistedinject.Assisted(value=NetworkA)
for parameter 4 at my.company.package.MyClass.<init>(MyClass.java:24)
while locating my.company.package.MyClass annotated with interface com.google.inject.assistedinject.Assisted
Any idea what is wrong? I found two other questions on this issue, one of them said it was a dependency issue which I don't think I have, the other said it was an Eclipse issue, which I do use, but I refreshed, cleaned, and rebuilt my maven projects from scratch, so I'm not sure what the problem is.
I am using javax.annotation.Nullable, which is supposed to be retained at Runtime. What else should I try?