我在代码中添加了一个新的Webservice。为此,我必须添加一个新的具体数据集。
import java.io.Serializable;
import javax.xml.bind.annotation.XmlRootElement;
import com.swipex.common.authenticator.IAuthenticable;
public class CServiceCenterOwnerDetails implements IServiceCenterOwnerDetails,
IServiceCenterOwnerDetailsSetters, IAuthenticable, Serializable {
private static final long serialVersionUID = 1L;我得到的例外是
com.sun.jersey.api.client.clienthandlerexception: a message body writer for java type, class , and mime media type, application/json, was not found at com.sun.jersey.client.urlconnection.urlconnectionclienthandler.handle发布于 2014-12-15 06:32:00
我所要做的就是向类定义中添加一个注释@XmlRootElement,并且它工作了。
import java.io.Serializable;
import javax.xml.bind.annotation.XmlRootElement;
import com.swipex.common.authenticator.IAuthenticable;
@XmlRootElement
public class CServiceCenterOwnerDetails implements IServiceCenterOwnerDetails,
IServiceCenterOwnerDetailsSetters, IAuthenticable, Serializable {
private static final long serialVersionUID = 1L;参考this的答案,尽管它没有为我的问题指出完美的解决方案,但它确实有一个提示。
https://stackoverflow.com/questions/27478519
复制相似问题