When this gets called, the result on the wire is:

No message body writer has been found for class
com.basistech.raas.annotatorservice.AnnotatorService$2, ContentType:
application/json

I must be missing something simple.



@POST
@Produces("application/json")
@Consumes(MediaType.TEXT_PLAIN)
@Path("annotatePlain")
public StreamingResponse<AnnotatedText> annotatePlain(String text)
throws IOException, RosetteException {
    AnnotatedText inputText = new AnnotatedText.Builder().data(text).build();
    final AnnotatedText result = pipeline.createAnnotator().annotate(inputText);
    return new StreamingResponse<AnnotatedText>() {
        @Override
        public void writeTo(Writer<AnnotatedText> writer) throws IOException {
            mapper.writeValue(writer.getEntityStream(), result);
        }
    };
}

Reply via email to