0

I wrote a web service and i got this error. How can i fix this error ?

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.
Fatih Yakut
  • 301
  • 1
  • 4
  • 16

1 Answers1

3

The problem is with the class org.apache.spark.mllib.recommendation.Rating which does not contain a default constructor.

i.e.

public Rating() {}

However, it would appear that this class is not part of your code and hence you cannot add it.

So, my question would be why are you passing a third party type over your web service interface? This does not seem like a good idea to me. You want to have complete control over this interface and the types on it.

Perhaps you could come up with your own type, ensuring it has a default constructor defined and then on receipt, map the data from it to the type org.apache.spark.mllib.recommendation.Rating.

JamesB
  • 7,774
  • 2
  • 22
  • 21