![client client](https://c1.lmlphp.com/image/static/default_avatar.gif)
本文介绍了GWT IncompatibleRemoteServiceException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
直截了当,但令人生气,我在RPC调用中遇到这个错误:
处理此调用时抛出了IncompatibleRemoteServiceException。
com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException:com.milkrun.core.dto.UserBasket的无效类型签名
这里是类导致的问题:
public class UserBasket implements Serializable {
private static final long serialVersionUID = -6761554796753637352L ;
public int userBasketID;
public String description;
public String userID;
公共列表< BasketItem>项目;
public String createUserId;
public Timestamp createTs;
public String lastUpdateUserId;
public Timestamp lastUpdateTs;
public Timestamp effStartTs;
public Timestamp effStopTs;
和BasketItem类型:
public class BasketItem implements Serializable {
private static final long serialVersionUID = -17764683871112216L;
public int basketItemID;
public String upc;
public String description;
public String brandName;
public BigDecimal价格;
public String createUserId;
public Timestamp createTs;
public String lastUpdateUserId;
public Timestamp lastUpdateTs;
public Timestamp effStartTs;
public Timestamp effStopTs;
}
我不确定我要出错的地方,我宁愿不使用IsSerializable,因为这些DTOs在一个由android应用程序共享的项目中,而IsSerializable也是GWT堆栈的一部分。
我在开发模式下遇到了这个问题。在我的情况下,问题是码头没有做一个干净的。我在工作区/ .metadata / .plugins / org.eclipse.wst.server.core /(例如my-module.jar)中手动删除了我的gwt模块的.jar文件。
然后,服务器端和客户端的类再次相同。
Straight forward but maddening, I get this error on my RPC call:
An IncompatibleRemoteServiceException was thrown while processing this call. com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException: Invalid type signature for com.milkrun.core.dto.UserBasket
Here is the class causing the issue:
public class UserBasket implements Serializable{
private static final long serialVersionUID = -6761554796753637352L;
public int userBasketID;
public String description;
public String userID;
public List<BasketItem> items;
public String createUserId;
public Timestamp createTs;
public String lastUpdateUserId;
public Timestamp lastUpdateTs;
public Timestamp effStartTs;
public Timestamp effStopTs;
}
And the type BasketItem:
public class BasketItem implements Serializable {
private static final long serialVersionUID = -17764683871112216L;
public int basketItemID;
public String upc;
public String description;
public String brandName;
public BigDecimal price;
public String createUserId;
public Timestamp createTs;
public String lastUpdateUserId;
public Timestamp lastUpdateTs;
public Timestamp effStartTs;
public Timestamp effStopTs;
}
I'm not sure where I'm going wrong and I'd rather not use IsSerializable as these DTOs are in a project shared by an android app too and IsSerializable is part of the GWT stack.
解决方案
I experienced this issue with the jetty in development mode. The problem in my case was that the jetty didnt do a "clean". I removed manually the .jar of my gwt module in workspace/.metadata/.plugins/org.eclipse.wst.server.core/ (e.g. my-module.jar)
After that, the class on the server side and client site were the same again.
这篇关于GWT IncompatibleRemoteServiceException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!