[GUICE/MISTIMPLENTION]:Viewloader没有实现
在运行 gradle运行时,我会遇到此错误:
1) [Guice/MissingImplementation]: No implementation for ViewLoader was bound.
Requested by:
1 : ModuleManager.<init>(ModuleManager.java:105)
\_ for 3rd parameter
at AppInitializer.moduleManager(AppInitializer.java:37)
\_ for field moduleManager
while locating AppInitializer
Learn more:
这是 modulemanager.java 的一部分
@Inject
public ModuleManager(
AuthService authService,
MetaModuleRepository modules,
ViewLoader viewLoader,
ModelLoader modelLoader,
I18nLoader i18nLoader,
DataLoader dataLoader,
DemoLoader demoLoader) {
this.authService = authService;
this.modules = modules;
this.viewLoader = viewLoader;
this.dataLoader = dataLoader;
this.demoLoader = demoLoader;
metaLoaders = ImmutableList.of(modelLoader, viewLoader, i18nLoader);
}
,而这是 view> view> view loadloader.java的一部分:
public abstract class ViewLoader extends AbstractParallelLoader {
private static final Logger LOG = LoggerFactory.getLogger(ViewLoader.class);
@Inject private ObjectMapper objectMapper;
@Inject private MetaViewRepository views;
@Inject private MetaSelectRepository selects;
@Inject private MetaActionRepository actions;
@Inject private MetaMenuRepository menus;
@Inject private MetaActionMenuRepository actionMenus;
@Inject private GroupRepository groups;
@Inject private XMLViews.FinalViewGenerator finalViewGenerator;
private final Set<String> viewsToGenerate = ConcurrentHashMap.newKeySet();
private final Map<String, List<String>> viewsToMigrate = new ConcurrentHashMap<>();
private final Map<String, List<Consumer<Group>>> groupsToCreate = new ConcurrentHashMap<>();
我希望这足以作为来源,我不能发布所有代码。 我不知道错误是什么意思。
I am getting this error when running gradle run :
1) [Guice/MissingImplementation]: No implementation for ViewLoader was bound.
Requested by:
1 : ModuleManager.<init>(ModuleManager.java:105)
\_ for 3rd parameter
at AppInitializer.moduleManager(AppInitializer.java:37)
\_ for field moduleManager
while locating AppInitializer
Learn more:
this is a partion of ModuleManager.java where the bug is
@Inject
public ModuleManager(
AuthService authService,
MetaModuleRepository modules,
ViewLoader viewLoader,
ModelLoader modelLoader,
I18nLoader i18nLoader,
DataLoader dataLoader,
DemoLoader demoLoader) {
this.authService = authService;
this.modules = modules;
this.viewLoader = viewLoader;
this.dataLoader = dataLoader;
this.demoLoader = demoLoader;
metaLoaders = ImmutableList.of(modelLoader, viewLoader, i18nLoader);
}
and this is a portion of viewloader.java :
public abstract class ViewLoader extends AbstractParallelLoader {
private static final Logger LOG = LoggerFactory.getLogger(ViewLoader.class);
@Inject private ObjectMapper objectMapper;
@Inject private MetaViewRepository views;
@Inject private MetaSelectRepository selects;
@Inject private MetaActionRepository actions;
@Inject private MetaMenuRepository menus;
@Inject private MetaActionMenuRepository actionMenus;
@Inject private GroupRepository groups;
@Inject private XMLViews.FinalViewGenerator finalViewGenerator;
private final Set<String> viewsToGenerate = ConcurrentHashMap.newKeySet();
private final Map<String, List<String>> viewsToMigrate = new ConcurrentHashMap<>();
private final Map<String, List<Consumer<Group>>> groupsToCreate = new ConcurrentHashMap<>();
I hope this is enough as a source, I can't post all the code.
I don't know what the error means.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ViewLoader
是一个抽象类。 Guice只是说您需要提供可以实施的东西。 Guice无法实例化抽象类。因此,提供具有具体实现的绑定:然后在模块中绑定实现:
ViewLoader
is an abstract class. Guice simply says that you need to provide something it can instanciate. Guice can't instantiate abstract class. So provide a binding with a concrete implementation:Then bind the implementation in your module: