2016-04-01 188 views
1

我想用GWT創建Atmosphere客戶端端。 我加無法編譯Atmosphere GWT客戶端端

atmosphere-annotations-2.4.3.jar 
atmosphere-gwt20-client-2.4.2.jar 
atmosphere-gwt-common-2.4.2.jar 
atmosphere-runtime-2.4.3.jar 

的構建路徑,插入

<inherits name="org.atmosphere.gwt20.AtmosphereGwt20"/> 
<inherits name='com.google.gwt.core.Core'/> 
<inherits name="com.google.web.bindery.autobean.AutoBean"/> 

到projectname.get.xml

我嘗試發起呼叫服務器像

GwtRpcClientSerializer rpc_serializer = GWT.create(GwtRpcClientSerializer.class); 
// or 
// RPCSerializer rpc_serializer = GWT.create(RPCSerializer.class); 

AtmosphereRequestConfig jerseyRpcRequestConfig = AtmosphereRequestConfig.create(rpc_serializer); 
jerseyRpcRequestConfig.setUrl(GWT.getHostPageBaseURL() + "it/more/atmosphere"); 
jerseyRpcRequestConfig.setTransport(AtmosphereRequestConfig.Transport.WEBSOCKET); 
jerseyRpcRequestConfig.setFallbackTransport(AtmosphereRequestConfig.Transport.STREAMING); 

,並在GWT編譯我得到

Caused by: java.lang.NoSuchMethodError: com.google.gwt.user.rebind.rpc.SerializableTypeOracleBuilder.<init>(Lcom/google/gwt/core/ext/TreeLogger;Lcom/google/gwt/core/ext/PropertyOracle;Lcom/google/gwt/core/ext/GeneratorContext;)V 
    [java]  at org.atmosphere.gwt20.rebind.SerializerGenerator.generateIncrementally(SerializerGenerator.java:87) 
    [java]  at com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:754) 
    [java]  at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:160) 
    [java]  at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:79) 
    [java]  at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:276) 
    [java]  at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:265) 
    [java]  at com.google.gwt.dev.DistillerRebindPermutationOracle.getAllPossibleRebindAnswers(DistillerRebindPermutationOracle.java:87) 
    [java]  at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.createStaticRebindExpression(UnifyAst.java:485) 
    [java]  at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.createRebindExpression(UnifyAst.java:443) 
    [java]  at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.handleMagicMethodCall(UnifyAst.java:576) 
    [java]  at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.endVisit(UnifyAst.java:306) 
    [java]  at com.google.gwt.dev.jjs.ast.JMethodCall.traverse(JMethodCall.java:248) 
    [java]  at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381) 
    [java]  at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293) 
    [java]  ... 40 more 
    [java]  [ERROR] at FilePresenter.java(137): GWT.create(RPCSerializer.class) 
    [java]   com.google.gwt.dev.jjs.ast.JMethodCall 
    [java]  [ERROR] at FilePresenter.java(137): (RPCSerializer) GWT.create(RPCSerializer.class) 
    [java]   com.google.gwt.dev.jjs.ast.JCastOperation 
    [java]  [ERROR] at FilePresenter.java(137): RPCSerializer rpc_serializer = (RPCSerializer) GWT.create(RPCSerializer.class) 
    [java]   com.google.gwt.dev.jjs.ast.JDeclarationStatement 
    [java]  [ERROR] at FilePresenter.java(122): { 

[java]  [ERROR] Line 137: Failed to resolve 'org.atmosphere.gwt20.client.GwtRpcClientSerializer' via deferred binding 
[java] [WARN] For the following type(s), generated source was never committed (did you forget to call commit()?) 

我遵循GWT示例代碼。我錯過了什麼?

回答

1

看來該項目在GWT 2.7中存在問題。某處,我發現諮詢與客戶端jar版本2.3.2-get27編譯它,並將它與罐子

atmosphere-annotations-2.4.3.jar 
atmosphere-gwt20-client-2.3.2-gwt27.jar 
atmosphere-gwt20-common-2.3.2-gwt27.jar 
atmosphere-runtime-2.4.3.jar 

只有

<inherits name="org.atmosphere.gwt20.AtmosphereGwt20"/> 

內projectname.gwt.xml

目前我的工作m面臨的問題與

Atmosphere atmosphere = Atmosphere.create(); 

仍然是null但這是ano有事要看(我想)。

+1

如果你很樂意使用早期版本,我已經看到氣氛gwt客戶端工作正常,版本到2.4.0。即使我看到與最新版本2.4.2/2.4.3相同的例外情況,如果我找到任何解決方案/解決方法,它也會更新 – Ajax