0 Replies Latest reply on Mar 13, 2019 4:05 AM by nickarls

    WF16 RESTEasy JSON-B integration

    nickarls

      Do you need any specific tricks (jboss-deployment-structure-xml references etc) in order to hook up JSON-B for RESTEasy clients?

      I have a @Provider for ContextResolver<Jsonb> with an adapter for java.nio.file.Path but my debugger never hits it when I do a client call that needs serialization and I end up with

       

      Caused by: javax.ws.rs.ProcessingException: RESTEASY008205: JSON Binding serialization error javax.json.bind.JsonbException: Error getting value...

      java.lang.IllegalAccessException: Class org.eclipse.yasson.internal.model.GetFromGetter can not access a member of class sun.nio.fs...

       

      Also, when looking at the other end, I have an endpoint like

       

      @Path("md5/{env}")
      @POST
      @Consumes(MediaType.APPLICATION_JSON)
      @Produces(MediaType.APPLICATION_JSON)
      public Map<artifact, string=""> getMD5(@PathParam("env") String environmentId, Collection artifacts);

       

      and I see the ArtifactAdapter hit when deserializing the json in the body but for serializing, the adapter is not hit and I just get a toString() from the Artifact class

       

      At this point, any references to documention that explains how JSON-B integrates in various parts of the lifecycle. Is it something like

       

      a) On the client side RESTEasy client posts a Entity.json(payload) and it uses the @Provider ContextResolver<Jsonb> implementation (hooked up with the adapters) for serialization of the json for the body

      b) On the server side, the @Provider ContextResolver<Jsonb> implementation (hooked up with the adapters) deserializes the request

      c) On the server side, the @Provider ContextResolver<Jsonb> implementation (hooked up with the adapters) serializes the response

       

      (if @PathParams etc would be used, on server side the @Provider ParamConverterProvider gives the correct ParamConverter would deserialize the parameters)

       

      And more interesting, why isn't the serializing of the response happening? :-/

       

      Thanks in advance,

        Nik