我正在开发一个GWT应用程序。应用程序。在开发模式下工作。
我正在处理一个gwt项目,并试图将其部署到Apache。我以前从未使用过,我对Java和GWT相当陌生。我的tomcat服务器似乎已经启动并运行,因为我在localhost上看到了“如果您看到这个,您已经成功地安装了Tomcat”:8080/
在启动和运行Tomcat之后,我使用Eclipse编译来编译我的应用程序。我已经将我的.html文件和.css文件+ war文件夹复制到C:\apache-tomcat-8.0.15\webapp\MyAPP\
打开(file:///C:/apache-tomcat-8.0.15/webapps/PurchaseOrder/PurchaseOrder.html)文件给我ui (登录屏幕),但是当进行第一次RPC调用(loggin )时,我得到了错误"FailureUnable来启动异步服务调用(PurchaseOrderService_Proxy.checkUsernameAndPassword) --检查网络连接“。
我的想法是,在我的web.xml或服务类中有不正确的地方。
PurchaseOrderService.java
package com.google.gwt.sample.purchaseorder.client;
import java.util.ArrayList;
import java.util.HashMap;
import com.google.gwt.sample.purchaseorder.client.model.Brands;
import com.google.gwt.sample.purchaseorder.client.model.Item;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
@RemoteServiceRelativePath("exampleservice")
public interface PurchaseOrderService extends RemoteService {
boolean checkUsernameAndPassword(String value, String value2);
ArrayList<Item> getPersonalInfo();
HashMap<String, ArrayList<Item>> getListOfPurchaseOrderSortedFromBrands();
String createExcelExportFile(HashMap<String, ArrayList<Item>> exportMap);
}web.xml:
<!-- Servlets -->
<servlet>
<servlet-name>purchaseOrderServiceImpl</servlet-name>
<servlet-class>com.google.gwt.sample.purchaseorder.server.PurchaseOrderServiceImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>purchaseOrderServiceImpl</servlet-name>
<url-pattern>/purchaseorder/exampleservice</url-pattern>
</servlet-mapping>
<!-- Default page to serve -->
<welcome-file-list>
<welcome-file>PurchaseOrder.html</welcome-file>
</welcome-file-list>
</web-app>发布于 2014-11-13 05:46:05
打开(file:///C:/apache-tomcat-8.0.15/webapps/PurchaseOrder/PurchaseOrder.html)文件给我ui (登录屏幕),但是当进行第一次RPC调用(loggin )时,我得到了错误"FailureUnable来启动异步服务调用(PurchaseOrderService_Proxy.checkUsernameAndPassword) --检查网络连接“。
这不是访问Tomcat中运行的应用程序的方式。您的tomcat正在运行@ localhost:8080,所以您必须使用http://localhost:8080/<app_context_root>/filename.html访问
https://stackoverflow.com/questions/26899528
复制相似问题