首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >GWT RCP ServiceEntryPointSpecifiedException

GWT RCP ServiceEntryPointSpecifiedException
EN

Stack Overflow用户
提问于 2011-07-22 00:24:03
回答 1查看 192关注 0票数 2

Sry我是这个话题的新手,但是当我想要进行rpc调用时,我总是得到这个异常:

原因:未指定com.google.gwt.user.client.rpc.ServiceDefTarget$NoServiceEntryPointSpecifiedException:服务实现URL

我不知道为什么,因为我已经让它像gwt教程一样。

这是我的源代码:

代码语言:javascript
复制
web.xml:
<web-app>

<servlet>
    <servlet-name>SpeicherService</servlet-name>
    <servlet-class>de.fhdo.kuss.server.SpeicherServiceImpl</servlet-class>
</servlet>

<servlet-mapping>
    <servlet-name>SpeicherService</servlet-name>
    <url-pattern>/SpeicherService</url-pattern>
</servlet-mapping>

<!-- Default page to serve -->
<welcome-file-list>
    <welcome-file>Kuss_Projekt.html</welcome-file>
</welcome-file-list>

</web-app>

-

代码语言:javascript
复制
Kuss_Projekt.gwt.xml:
<module rename-to='kuss_projekt'>
<!-- 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='de.fhdo.kuss.client.Kuss_Projekt' />

<!-- Specify the paths for translatable code -->
<source path='client' />
<source path='shared' />

 </module>

-

代码语言:javascript
复制
Speicherservice:
@RemoteServiceRelativePath("SpeicherService")
public interface SpeicherService extends RemoteService {

  String getName(String name);

  public static class Util {
    private static SpeicherServiceAsync instance;
    public static SpeicherServiceAsync getInstance(){
      if (instance == null) {
        instance = GWT.create(SpeicherService.class);
      }
    return instance;
   }
  }
}

-

代码语言:javascript
复制
SpeicherServiceAsync:
public interface SpeicherServiceAsync {

  void getName(String name, AsyncCallback<String> callback);

}

-

代码语言:javascript
复制
SpeicherServiceImpl:
public class SpeicherServiceImpl extends RemoteServiceServlet implements SpeicherService {

@Override
  public String getName(String name) {
    return("Server meldet sich " + name);
  }
}

-

代码语言:javascript
复制
Test():
public void test() {
AsyncCallback<String> callback = new AsyncCallback<String>() {

    @Override
    public void onFailure(Throwable caught) {
        // TODO Auto-generated method stub
    }

    @Override
    public void onSuccess(String result) {
        Window.alert(result);
    }
};

SpeicherService.Util.getInstance().getName("test",callback);
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-07-22 03:53:04

添加回:

代码语言:javascript
复制
@RemoteServiceRelativePath("SpeicherService") 

然后在你的web.xml中替换

代码语言:javascript
复制
<url-pattern>/SpeicherService</url-pattern>

使用

代码语言:javascript
复制
<url-pattern>/kuss_projekt/SpeicherService</url-pattern>

之所以需要这样做,是因为您在gwt.xml中使用了:<module rename-to='kuss_projekt'>

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/6779410

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档