我编写了一个web服务,得到了这个错误。如何修复此错误?
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.发布于 2014-07-07 20:17:06
问题出在org.apache.spark.mllib.recommendation.Rating类,它不包含默认构造函数。
即
public Rating() {}但是,这个类似乎不是您的代码的一部分,因此您无法添加它。
所以,我的问题是,为什么要在web服务接口上传递第三方类型?在我看来,这不是一个好主意。您希望完全控制此接口及其上的类型。
也许您可以想出自己的类型,确保它有一个定义的默认构造函数,然后在收到时,将其中的数据映射到类型org.apache.spark.mllib.recommendation.Rating。
https://stackoverflow.com/questions/24610221
复制相似问题