【发布时间】:2023-04-10 15:15:01
【问题描述】:
我在服务器上部署我的 GWT 应用程序,在开发模式下,使用 eclipse。
RPC 调用工作正常,但在我部署到 tomcat 服务器后,我无法进行调用。
这是浏览器的控制台显示的内容:
加载资源失败:服务器响应状态为 404 (未找到)http://greenti.platon.com.br/war2/softheart/adminService 加载资源失败:服务器响应状态为 404 (未找到)
这是我的web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee">
<!-- Default page to serve -->
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>adminService</servlet-name>
<servlet-class>greenti.server.service.AdminServiceImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>adminService</servlet-name>
<url-pattern>/softheart/adminService</url-pattern>
</servlet-mapping>
</web-app>
我的班级Service:
@RemoteServiceRelativePath("adminService")
public interface AdminService extends RemoteService{
...
}
我的.gwt.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!--
When updating your version of GWT, you should also update this DTD reference,
so that your app can take advantage of the latest GWT module capabilities.
-->
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.5.1//EN"
"http://google-web-toolkit.googlecode.com/svn/tags/2.5.1/distro-source/core/src/gwt-module.dtd">
<module rename-to='softheart'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User'/>
<!-- Inherit the default GWT style sheet. You can change -->
<!-- the theme of your GWT application by uncommenting -->
<!-- any one of the following lines. -->
<inherits name='com.google.gwt.user.theme.clean.Clean'/>
<!-- <inherits name='com.google.gwt.user.theme.standard.Standard'/> -->
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
<!-- Other module inherits -->
<!-- Specify the app entry point class. -->
<entry-point class='greenti.client.view.PanelMain'/>
<!-- Specify the paths for translatable code -->
<source path='client'/>
<source path='shared'/>
</module>
任何帮助将不胜感激
【问题讨论】:
标签: java eclipse tomcat gwt rpc