Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-2172

Rest Client fails to convert a single boolean value

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 3.8.0.Final, 4.1.0.Final
    • 3.6.3.Final
    • None
    • None

      Clone of JBEAP-16475 jira


      javax.ws.rs.core.Response.readEntity(Class<T>) fails to convert a single boolean value, i.e. with Boolean.class as argument.

      Exception in thread "main" javax.ws.rs.ProcessingException: RESTEASY008200: JSON Binding deserialization error: null
      	at org.jboss.resteasy.plugins.providers.jsonb.JsonBindingProvider.readFrom(JsonBindingProvider.java:88)
      	at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.readFrom(AbstractReaderInterceptorContext.java:66)
      	at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:56)
      	at org.jboss.resteasy.client.jaxrs.internal.ClientResponse.readFrom(ClientResponse.java:341)
      	at org.jboss.resteasy.client.jaxrs.internal.ClientResponse.readEntity(ClientResponse.java:268)
      	at org.jboss.resteasy.specimpl.BuiltResponse.readEntity(BuiltResponse.java:237)
      	at org.jboss.qa.resteasy.test.resource.App.main(App.java:25)
      Caused by: java.util.NoSuchElementException
      	at org.glassfish.json.JsonParserImpl.next(JsonParserImpl.java:361)
      	at org.eclipse.yasson.internal.JsonbRiParser.next(JsonbRiParser.java:140)
      	at org.eclipse.yasson.internal.JsonbRiParser.moveTo(JsonbRiParser.java:221)
      	at org.eclipse.yasson.internal.JsonbRiParser.moveToValue(JsonbRiParser.java:208)
      	at org.eclipse.yasson.internal.serializer.BooleanTypeDeserializer.deserialize(BooleanTypeDeserializer.java:44)
      	at org.eclipse.yasson.internal.serializer.BooleanTypeDeserializer.deserialize(BooleanTypeDeserializer.java:31)
      	at org.eclipse.yasson.internal.Unmarshaller.deserializeItem(Unmarshaller.java:61)
      	at org.eclipse.yasson.internal.Unmarshaller.deserialize(Unmarshaller.java:51)
      	at org.eclipse.yasson.internal.JsonBinding.deserialize(JsonBinding.java:45)
      	at org.eclipse.yasson.internal.JsonBinding.fromJson(JsonBinding.java:85)
      	at org.jboss.resteasy.plugins.providers.jsonb.JsonBindingProvider.readFrom(JsonBindingProvider.java:80)
      	... 6 more
      

      I think it cased by this issue https://github.com/eclipse-ee4j/yasson/issues/188, which I guess will be fixed in version org.eclipse:yasson:1.0.4

      If I exclude org.jboss.resteasy.resteasy-json-binding-provider it works.

           <exclusions>
                  <module name="org.jboss.resteasy.resteasy-json-binding-provider" />
           </exclusions>
      

      json-b can be disabled on server side also by variable

      -Dresteasy.preferJacksonOverJsonB=true

              rsearls r searls
              mkopecky@redhat.com Marek Kopecky
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: