注入com.gwtplatform.dispatch.rest.client.ActionMetadataProvider时出错

注入com.gwtplatform.dispatch.rest.client.ActionMetadataProvider时出错,gwt,gwtp,gwt-platform,Gwt,Gwtp,Gwt Platform,我有以下问题: 12:45:47.505 [ERROR] [cGui] Error injecting com.gwtplatform.dispatch.rest.client.ActionMetadataProvider: Unable to create or inherit binding: No @Inject or default constructor found for com.gwtplatform.dispatch.rest.client.ActionMetadataProvi

我有以下问题:

12:45:47.505 [ERROR] [cGui] Error injecting com.gwtplatform.dispatch.rest.client.ActionMetadataProvider: Unable to create or inherit binding: No @Inject or default constructor found for com.gwtplatform.dispatch.rest.client.ActionMetadataProvider
Path to required node:

com.gwtplatform.dispatch.rest.client.RestRequestBuilderFactory   [com.gwtplatform.dispatch.rest.client.gin.RestDispatchAsyncModule.configureDispatch(RestDispatchAsyncModule.java:100)]
->; com.gwtplatform.dispatch.rest.client.DefaultRestRequestBuilderFactory [com.gwtplatform.dispatch.rest.client.gin.RestDispatchAsyncModule.configureDispatch(RestDispatchAsyncModule.java:100)]
->; com.gwtplatform.dispatch.rest.client.ActionMetadataProvider [@Inject constructor of com.gwtplatform.dispatch.rest.client.DefaultRestRequestBuilderFactory]
My
gwt.xml

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.6.1//EN"
    "https://raw.githubusercontent.com/gwtproject/gwt/2.6.1/distro-source/core/src/gwt-module.dtd">
<module rename-to="cGui">
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User' />
<inherits name='com.google.gwt.inject.Inject' />

<!-- Default css -->
<inherits name='com.google.gwt.user.theme.standard.Standard' />
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->

<!-- Other module inherits -->
<inherits name='com.gwtplatform.dispatch.Dispatch' />
<inherits name='com.gwtplatform.mvp.MvpWithEntryPoint' />
<!--    <inherits name="de.barop.gwt.PushState" /> -->

<inherits name='com.gwtplatform.dispatch.rest.DispatchRest' />
<inherits name="com.google.gwt.uibinder.GinUiBinder" />
<!--    <inherits name="com.gwtplatform.mvp.MvpWithFormFactor" />  -->

<inherits name="com.google.gwt.query.Query" />
<inherits name="com.google.common.collect.Collect" />
<!--    <inherits name="com.googlecode.objectify.Objectify" />  -->
<inherits name="com.gwtplatform.dispatch.rpc.DispatchRpc" />

<source path='client' />
<source path='shared' />

<set-configuration-property name="gin.ginjector.modules"
    value="*CENSORED*.client.gin.ClientModule" />
</module>
代码基于标签1.3.1

我的依赖项:

我试过什么:

我确保每个枚举和DTO都是可序列化的

试图摆弄gwt.xml

谷歌搜索了很多

在过去的5个小时里,我一直在努力解决这个问题


如果我忘记附上一些文件,或者没有提供足够的细节,请告诉我。我会相应地更新这篇文章。

在你的gwt.xml中,
DispatchRest
必须在
MvpWithEntryPoint
之前。您应该阅读此处的重要注释,因为所有的陷阱都已解释:



另外,
Dispatch
是一个不推荐使用的模块,因此您应该改用
DispatchRpc

多谢各位。很好的回答和解释。:)这个答案对我也有帮助。它不仅适用于MvpWithEntryPoint,还适用于常规的com.gwtplatform.mvp.mvp。结果表明,包含顺序很重要。你可能节省了几个小时的闲逛时间。
public class ClientModule extends AbstractPresenterModule {

private static Logger logger = Logger.getLogger(ClientModule.class.getName());

@Override
protected void configure() {
    logger.log(Level.INFO, "Installing Client Module dependencies");
    install(new DefaultModule());
    logger.log(Level.INFO, "DefaultModule installed");
    install(new SecurityModule());
    logger.log(Level.INFO, "SecurityModule installed");
    install(new ApplicationModule());
    logger.log(Level.INFO, "ApplicationModule installed");
    install(new RestDispatchAsyncModule());
    logger.log(Level.INFO, "RestDispatchAsyncModule installed");
    install(new RpcDispatchAsyncModule());
    logger.log(Level.INFO, "RpcDispatchAsyncModule installed");
    // DefaultPlaceManager Places
    bindConstant().annotatedWith(DefaultPlace.class).to(NameTokens.LOGIN);
    bindConstant().annotatedWith(ErrorPlace.class).to(NameTokens.ERROR);
    bindConstant().annotatedWith(UnauthorizedPlace.class).to(NameTokens.UNAUTHORIZED);
    bindConstant().annotatedWith(RestApplicationPath.class).to("/rest");
    }
}
<!-- Other module inherits -->
<inherits name='com.gwtplatform.dispatch.rpc.DispatchRpc' />
<inherits name='com.gwtplatform.dispatch.rest.DispatchRest' />
<inherits name='com.gwtplatform.mvp.MvpWithEntryPoint' />
<inherits name="com.google.gwt.uibinder.GinUiBinder" />

<extend-configuration-property name="gin.ginjector.modules"
    value="*CENSORED*.client.gin.ClientModule" />