moxy messagebodywriter not found for media type=application/json, again..

classic Classic list List threaded Threaded
2 messages Options
nnn
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

moxy messagebodywriter not found for media type=application/json, again..

nnn
hi
getting error
[org.glassfish.jersey.message.internal.WriterInterceptorExecutor] [[
  MessageBodyWriter not found for media type=application/json, type=class java.util.HashMap, genericType=class java.util.HashMap.]]

added on pom.xml
    <dependency>
      <groupId>org.glassfish.jersey.media</groupId>
      <artifactId>jersey-media-moxy</artifactId>
      <version>2.22.2</version>
    </dependency>

also added in

public class MainRsConfig extends ResourceConfig {
register(MvcFeature.class);
...

code

  @POST
  @Path("w2ui")
  @Consumes(MediaType.APPLICATION_JSON)
  @Produces(MediaType.APPLICATION_JSON)
  public Response w2uiCrudAccount(FormCommand command) {
    Map<String, String> res = Maps.newHashMap();
    res.put("status", "success");
    return Response.status(Response.Status.CREATED).entity(res).build();
  }

for pojo getting the same error, and for @Produces(MediaType.APPLICATION_XML) too

that`s wrong ?
thanks

nnn
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: moxy messagebodywriter not found for media type=application/json, again..

nnn
resolved with register(GensonJsonConverter.class); in ResourceConfig
Loading...