2013-03-12 63 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

将它添加到您的构建路径后应该工作。