繁体   English   中英

尝试在Apache Tomcat上部署GWT失败

[英]Failure trying to deploy GWT on Apache Tomcat

我正在研究GWT应用程序。 该应用程序。 正在开发模式下工作。

我正在处理gwt项目,并尝试将其部署到Apache Tomcat。 我以前从未使用过Apache Tomcat,而我是Java和GWT的新手。 我的tomcat服务器似乎已启动并正在运行,因为我在localhost:8080 /上看到了“如果看到了,说明您已经成功安装了Tomcat”。

在启动并运行Tomcat之后,我使用Eclipse GWT Compile来编译我的应用程序。 我已将.html文件和.css文件+ war文件夹复制到C:\\ apache-tomcat-8.0.15 \\ webapps \\ MyAPP \\

打开.html文件(file:/// C:/apache-tomcat-8.0.15/webapps/PurchaseOrder/PurchaseOrder.html),可以得到我的ui(登录屏幕),但是在进行首次RPC调用时(登录)我收到错误消息“ 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>

打开.html文件(file:/// C:/apache-tomcat-8.0.15/webapps/PurchaseOrder/PurchaseOrder.html),可以得到我的ui(登录屏幕),但是在进行首次RPC调用时(登录)我收到错误消息“ FailureUnable无法启动异步服务调用(PurchaseOrderService_Proxy.checkUsernameAndPassword)-检查网络连接”

这不是访问Tomcat中运行的应用程序的方式。 您的tomcat正在运行@ localhost:8080,因此您必须使用http://localhost:8080/<app_context_root>/filename.html

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM