Hi Sergey,
thanks for the help.
I've another question for you... I hope this is the last :-)
Testing my REST API I've another anomalous behavior with this method:
@GET
@Path("/getUnitsOfMeasure/{appGardenID}/{protType}/{profileID}/{objectIDhigh}/{objectIDlow}")
@ApiOperation(value = "Tells you what are the units of measure for the
object.",
notes = "Returns the unit of measure of the
current object.", response = String.class,
produces="application/xml,application/json")
public String[] getUnitsOfMeasure(
@ApiParam(value = "appGardenID", required = true)
@WebParam(name = "appGardenID") @PathParam("appGardenID")
@CxfWSAuthGrain(type=authType.appGarden) int appGardenID,
@ApiParam(value = "protType", required = true)
@WebParam(name = "protType") @PathParam("protType") short protType,
@ApiParam(value = "profileID", required = true)
@WebParam(name = "profileID") @PathParam("profileID") int profileID,
@ApiParam(value = "objectIDhigh", required = true)
@WebParam(name = "objectIDhigh") @PathParam("objectIDhigh") int
objectIDhigh,
@ApiParam(value = "objectIDlow", required = true)
@WebParam(name = "objectIDlow") @PathParam("objectIDlow") int objectIDlow)
throws InstantiationException;
I'm not able to properly manage the return type String[].
If I do not use @Produces annotation and I invoke the web method from a web
browser I see the String[] JSON formatted, but if I call the web method from
java code the exception:
.No message body reader has been found for class : class
[Ljava.lang.String;, ContentType : application/json.
occurs on client side. I see the same exception if I call the web method
from Swagger U.I. with xml format expetced (if I select json format no
problem occurs).
I've tried to use also one of these annotations:
@Produces("multipart/form-data") / @Produces("multipart/mixed") /
@Produces("multipart/mixed;type=text/xml")...
but the situation worsens and an exception occurs server side before
arriving in the implementor.
Can you help me?
Thanks a lot,
Andrea
--
View this message in context:
http://cxf.547215.n5.nabble.com/java-lang-ClassCastException-B-cannot-be-cast-to-Ljava-lang-Object-tp5730141p5730240.html
Sent from the cxf-user mailing list archive at Nabble.com.