gpt4 book ai didi

java - 调用 RPC 时出错 - GWT,404 服务器响应状态为 404(未找到)

转载 作者:行者123 更新时间:2023-11-28 22:58:40 25 4
gpt4 key购买 nike

我在开发模式下使用 eclipse 在服务器上部署我的 GWT 应用程序。
RPC 调用工作正常,但在我部署到 tomcat 服务器后,我无法进行调用。这是浏览器控制台显示的内容:

Failed to load resource: the server responded with a status of 404 (Not Found) http://greenti.platon.com.br/war2/softheart/adminService Failed to load resource: the server responded with a status of 404 (Not Found)

这是我的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>

我的类(class)服务:

@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>

任何帮助将不胜感激

最佳答案

尝试:

http://greenti.platon.com.br/softheart/adminService

我不确定您为什么在路径中使用/war2/。

关于java - 调用 RPC 时出错 - GWT,404 服务器响应状态为 404(未找到),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22976762/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com