Open taodongl opened 6 years ago
I don't know this module well (or Guice), but from exception it sounds like there is no binding on Guice for type Map
?
I can inject successfully outside Jackson Module.
public static void main(String[] args) {
Injector injector = Guice.createInjector(Stage.PRODUCTION, new BootstrapModule());
Configure configure = new Configure();
injector.injectMembers(configure);
... ...
}
So my workaround is: put MapBinder Inject
into POJO class, and inject the POJO class in Configure.class:
final public class Manager {
@Inject
private Map<String, WorkspaceFactory> factoryMap;
... ...
}
final class Configure {
@Inject
private Manager manager;
... ...
}
... ...
Configure configure = mapper.readValue(file, Configure.class);
MapBinder
When I want to deserialize json:
Configure configure = mapper.readValue(file, Configure.class);
. I get the following errors: