2013-03-12 68 views
0

到現在爲止,我已將2個項目添加到我的GWT項目構建路徑並在gwt.xml中繼承它們以使用它們的類。一切運作良好。GWT添加jar而不是項目

然後我試着將gwt項目部署到tomcat,因此我需要創建兩個項目的.jar文件並將它們添加到構建路徑。但現在我得到錯誤。

 Compiling module com.wn.webapp.WebApp 
    Validating units: 
     Ignored 17 units with compilation errors in first pass. 
Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors. 
    Finding entry point classes 
     [ERROR] Errors in 'file:/C:/Users/laura.eckardt/workspace/WebApp/src/com/wn/webapp/client/ServiceCalls.java' 
     [ERROR] Line 24: The import com.wn.retail cannot be resolved 
     [ERROR] Line 25: The import com.wn.retail cannot be resolved 
     [ERROR] Line 26: The import com.wn.retail cannot be resolved 
     [ERROR] Line 27: The import com.wn.retail cannot be resolved 
     [ERROR] Line 28: The import com.wn.retail cannot be resolved 
     [ERROR] Line 187: LaneContact cannot be resolved to a type 
     [ERROR] Line 187: The type new AsyncCallback>(){} must implement the inherited abstract method AsyncCallback>.onSuccess(List) 
     [ERROR] Line 187: LaneContact cannot be resolved to a type 
     [ERROR] Line 196: The method onSuccess(List) of type new AsyncCallback>(){} must override or implement a supertype method 
     [ERROR] Line 196: LaneContact cannot be resolved to a type 
     [ERROR] Line 214: LaneStatus cannot be resolved to a type 
     [ERROR] Line 214: The type new AsyncCallback(){} must implement the inherited abstract method AsyncCallback.onSuccess(LaneStatus) 
     [ERROR] Line 214: LaneStatus cannot be resolved to a type 
     [ERROR] Line 223: The method onSuccess(LaneStatus) of type new AsyncCallback(){} must override or implement a supertype method 
     [ERROR] Line 223: LaneStatus cannot be resolved to a type 
     [ERROR] Line 343: LaneContact cannot be resolved to a type 
     [ERROR] Line 350: LaneStatus cannot be resolved to a type 
     [ERROR] Line 386: Request cannot be resolved to a type 
     [ERROR] Line 390: InquiryHolder cannot be resolved to a type 
     [ERROR] Line 419: The method setCurrentRequest(Request) from the type Lane refers to the missing type Request 
     [ERROR] Line 420: The method setCurrentInquiry(Inquiry) from the type Lane refers to the missing type Inquiry 
     [ERROR] Line 424: LaneStatus cannot be resolved to a type 
     [ERROR] Line 429: The method setTransactionEntries(Transaction) from the type ItemList refers to the missing type Transaction 
     [ERROR] Line 436: InputMethodHolder cannot be resolved to a type 
     [ERROR] Unable to find type 'com.wn.webapp.client.WebApp' 
     [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 

現在出了什麼問題?

+0

您的庫是否在您的'war/WEB-INF/lib'文件夾中,其中'war'是您放在Tomcat的'webapps /'文件夾中的應用程序的頂級文件夾? – enrybo 2013-03-12 11:48:29

+0

是的,他們是。我將它們添加到構建路徑 – Laura 2013-03-12 11:49:49

+0

您是否設法在開發模式下運行項目? – enrybo 2013-03-12 11:56:45

回答

1

當您創建您的jar文件時,您需要包含源文件(.java)。要在eclipse中這樣做,您需要右鍵單擊您的項目,然後選擇Export,然後在Java文件夾中選擇JAR file。在下一個屏幕中,檢查「導出Java源文件和資源」,然後選擇Finish

將它添加到您的構建路徑後應該工作。

相關問題