2012-11-05 63 views
1

XXX只是我需要保密的名字。GWT編譯錯誤 - Restlet相關?

Compiling module com.XXX.XXX.XXX_Test 
    Validating newly compiled units 
     Ignored 12 units with compilation errors in first pass. 
Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors. 
    Scanning for additional dependencies: file:/D:/Eclipse/Indigo/Workspace/XXX%20Test/src/com/XXX/XXX/client/Restlet.java 
     Computing all possible rebind results for 'com.wai.XXX.client.proxy.DonglesProxy' 
     Rebinding com.XXX.XXX.client.proxy.DonglesProxy 
      Checking rule <generate-with class='org.restlet.rebind.ClientProxyGenerator'/> 
       [ERROR] Errors in 'file:/D:/Eclipse/Indigo/Workspace/XXX%20Test/src/com/XXX/XXX/client/proxy/DonglesProxy.java' 
        [ERROR] Line 11: No source code is available for type org.restlet.resource.ClientProxy; did you forget to inherit a required module? 
       [ERROR] Unable to find type 'com.XXX.XXX.client.proxy.DonglesProxy' 
        [ERROR] Hint: Previous compiler errors may have made this type unavailable 
        [ERROR] Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly 

這是當我嘗試在我的項目上執行GWT編譯時,控制檯告訴我的內容。我不明白,我已經包含了「org.restlet.jar」到項目的構建路徑,並有在DonglesProxy源代碼如下進口:

import org.restlet.resource.ClientProxy; 
import org.restlet.resource.Put; 

任何人任何想法?

我是新來的Java和整個Web應用程序的過程,所以我的知識有點欠缺。這其實是別人的項目已經半途而廢,所以我試圖調試/理解別人的代碼,而學習,我沿着......夢魘:(

任何幫助,將不勝感激去!

乾杯 千電子伏

回答

2

稱爲GXT.xml一個XML文件,您必須使用:

  • 進口org.restlet。 客戶端 .resource.ClientProxy;
  • import org.restlet。 客戶端 .resource.Get;
  • import org.restlet。 客戶端 .resource.Post;
  • import org.restlet。 客戶端 .resource.Result;

定義代理;注意「客戶端」部分;

引用的導入必須是GWT分佈的一部分;

+0

嗨科馬,謝謝你回到我身邊。我嘗試使用org.restlet.client.resource.xxx,但我的項目不再構建並生成此錯誤。 –

+0

什麼錯誤?你需要,將GWT版本的restlet添加到您的類路徑中,並且可能在服務器的類路徑中實現服務器端的J2EE版本; – koma

+0

對不起,這是一個錯字,我設法解決GWT編譯,另一個問題,你能告訴我部署App Engine和運行爲Web應用程序的區別嗎? –

0

你必須將它添加到您的項目XML文件。這是com.XXX.XXX.XXX_Test.gwt.xml或類似的東西。 你要加入這一行有,

<inherits name='org.restlet.whateverClass.xmlfilename />' 

這意味着你被指向名爲xmlfilename.xml在路徑org.restlet.whteverclass

因此,例如說,如果我使用煎茶UI庫的jar的XML文件,我將增加,

<inherits name='com.sencha.gxt.ui.GXT' /> 

所以這裏將要在路徑「com.sencha.gxt.ui」

+0

完全不相關 – koma

+0

這不是無關緊要的,這是soution,他不得不在他的gwt.xml中添加繼承,如果他只是在他的類路徑中擁有它,那麼它不夠用 – mvairavan

+0

編譯錯誤中提到的類簡直就是錯誤的一個「org.restlet.resource.ClientProxy」;沒有將會包含這個類的模塊; – koma