GWTP&注入错误

时间:2015-04-24 09:02:03

标签: gwt inject gwtp

尝试呼叫服务时发现错误

private void startSendPacket() {
    Timer timer = new Timer() {
        @Override
        public void run() {
            packetService.sendPacketMSGToServer(str,
                    new AsyncCallback<Date>() {
                        @Override
                        public void onFailure(Throwable caught) {
                            StringBuilder sb = new StringBuilder(textLog)
                                    .append("\n ERORR!!!");
                            getView().getTextLog().setText(sb.toString());
                        }

                        @Override
                        public void onSuccess(Date date) {
                        StringBuilder sb = new StringBuilder(textLog)
                                    .append("\n GOOD!!!");
                            getView().getTextLog().setText(sb.toString());
                        }
                    });

            if (!statusReadyToSend)
                cancel();
        }

    };
    timer.scheduleRepeating(1000);
}

在这一行上使用String&amp; StringBuilder的。在代码的其他部分,它编译得很好。

                            StringBuilder sb = new StringBuilder(textLog)
                                    .append("\n ERORR!!!");

在评论出来时收到以下错误,一切正常。

[INFO] --- gwt-maven-plugin:2.7.0:compile (default) @ PacketSend ---
[INFO] Compiling module by.gwttest.PacketSend
[INFO]    Ignored 1 unit with compilation errors in first pass.
[INFO] Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
[INFO]    Computing all possible rebind results for 'com.gwtplatform.mvp.client.DesktopGinjector'
[INFO]       Rebinding com.gwtplatform.mvp.client.DesktopGinjector
[INFO]          Invoking generator com.google.gwt.inject.rebind.GinjectorGenerator
[INFO]             [ERROR] Error injecting by.gwttest.client.application.packet.PacketPagePresenter$MyProxy: Unable to create or inherit binding: No @Inject or default constructor found for by.gwttest.client.application.packet.PacketPagePresenter$MyProxy
[INFO]   Path to required node:
[INFO] 
[INFO] by.gwttest.client.application.packet.PacketPagePresenter$MyProxy [com.gwtplatform.mvp.client.gin.AbstractPresenterModule.bindPresenter(AbstractPresenterModule.java:121)]
[INFO] 
[INFO]             [ERROR] Error injecting by.gwttest.client.application.packet.PacketPageView$Binder: Unable to create or inherit binding: No @Inject or default constructor found for by.gwttest.client.application.packet.PacketPageView$Binder
[INFO]   Path to required node:
[INFO] 
[INFO] by.gwttest.client.application.packet.PacketPageView [com.gwtplatform.mvp.client.gin.AbstractPresenterModule.bindPresenter(AbstractPresenterModule.java:120)]
[INFO]  -> by.gwttest.client.application.packet.PacketPageView$Binder [@Inject constructor of by.gwttest.client.application.packet.PacketPageView]
[INFO] 
[INFO]    [ERROR] Errors in 'gen/com/gwtplatform/mvp/client/DesktopGinjectorProvider.java'
[INFO]       [ERROR] Line 8: Failed to resolve 'com.gwtplatform.mvp.client.DesktopGinjector' via deferred binding
[INFO] ------------------------------------------------------------------------

可以连接什么?

0 个答案:

没有答案