首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >JAX-RPC 1.1中的公共默认构造函数错误

JAX-RPC 1.1中的公共默认构造函数错误
EN

Stack Overflow用户
提问于 2014-07-07 20:06:07
回答 1查看 1.2K关注 0票数 0

我编写了一个web服务,得到了这个错误。如何修复此错误?

代码语言:javascript
复制
The service class "com.argedor.ttnetMusic.recommendationWebService.Recommender" does not comply to one or more requirements of the JAX-RPC 1.1 specification, and may not deploy or function correctly.
The value type "org.apache.spark.mllib.recommendation.Rating" used via the service class "com.argedor.ttnetMusic.recommendationWebService.Recommender" does not have a public default constructor. Chapter 5.4 of the JAX-RPC 1.1 specification requires a value type to have a public default constructor, otherwise a JAX-RPC 1.1 compliant Web service engine may be unable to construct an instance of the value type during deserialization.
EN

回答 1

Stack Overflow用户

发布于 2014-07-07 20:17:06

问题出在org.apache.spark.mllib.recommendation.Rating类,它不包含默认构造函数。

代码语言:javascript
复制
public Rating() {}

但是,这个类似乎不是您的代码的一部分,因此您无法添加它。

所以,我的问题是,为什么要在web服务接口上传递第三方类型?在我看来,这不是一个好主意。您希望完全控制此接口及其上的类型。

也许您可以想出自己的类型,确保它有一个定义的默认构造函数,然后在收到时,将其中的数据映射到类型org.apache.spark.mllib.recommendation.Rating。

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

https://stackoverflow.com/questions/24610221

复制
相关文章

相似问题

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