Questions tagged [http-message-converter]

21 questions
2
votes
1 answer

How config gson in Spring boot?

Spring Boot 2 In application.yml http: converters: preferred-json-mapper: gson Now I write class with custom settings for Gson: public class GsonUtil { public static GsonBuilder gsonbuilder = new GsonBuilder(); public static…
Alexei
  • 14,350
  • 37
  • 121
  • 240
1
vote
0 answers

Spring boot makes warning log HttpMessageNotWritableException from the reason that might come from WebSocket

I made a message system using Spring-Websocket. There was no errors and warnings in dev. However, it made some warnings in prod. 2022-10-17 13:24:32.894 WARN 1 --- [nio-8080-exec-9] .w.s.m.s.DefaultHandlerExceptionResolver :…
1
vote
1 answer

Could not extract response: no suitable HttpMessageConverter found for content type [application/octet-stream]

I am making a simple Rest call as below with no headers in java. But I get this exception message: Could not extract response: no suitable HttpMessageConverter found for response type [class…
user9877702
1
vote
2 answers

How to serialize an Instant without nanoseconds using Spring Boot with Jackson?

Spring uses Jackson's InstantSerializer to write out my Instant fields like this: now: "2021-04-07T10:51:53.043320Z" I don't want the nanoseconds, though - just the milliseconds. I guessed that setting the application…
1
vote
1 answer

SpringBoot Rest Controller Supporting both xml and json with JAXB Pojos + Custom Http Message Converters + Swagger-UI

Getting following Swagger error when I introduced custom message converters Unable to render this definition The provided definition does not specify a valid version field. Please indicate a valid Swagger or OpenAPI version field. Supported version…
1
vote
0 answers

How to use AbstractMessageConverter using RestTemplate

1.Summarize the problem I am trying to read comma separated values(CSV formatted data, not csv file) into responseEntity(ResponseEntity>> responseEntity) using RestTemplate. but, I get error…
1
vote
0 answers

MessageConverter issue while using RestTemplate with StreamingResponseBody

We have a REST API (server side) implemented using Spring Boot. This API is streaming a PDF file as StreamingResponseBody wrapped in ResponseEntity where content-type is given as MediaType.APPLICATION_OCTET_STREAM. I am trying to access this API…
1
vote
1 answer

How to solve "Error while extracting response for type [class com.*" in Spring Boot?

You might want to skip to my UPDATE 2 bellow I have a RestController that works, because when I access it directly from the browser, it returns a JSON response. However, when I send a request from a Service in a different bounded context, I get the…
1
vote
0 answers

Skip over an HttpMessageConverter if canRead and canWrite are false

I have a custom MappingJackson2HttpMessageConverter that I add to the top of the converters list: @Override public void extendMessageConverters(final List> converters) { converters.add(0,…
MeanwhileInHell
  • 6,780
  • 17
  • 57
  • 106
0
votes
1 answer

Conflicting/ambiguous property name definitions while serializing

I have a class AusgangsrechnungGeneral which has a property "abrechnungsmonat". It is set from JSON via Jackson which has the same property, but defined as "abrechnungsMonat" - which works fine. Now I need to deserialize the property…
0
votes
0 answers

Spring Boot don't call my custom HttpMessageConverter

I am implementing a HttpMessageConverter and when I invoke the endpoint Spring Boot call AbstractJackson2HttpMessageConverter instead mine. I am using Spring Boot 2.7.6. The endpoint: public DocumentId createDocument(List files) The WebConfig…
Lau13
  • 128
  • 1
  • 3
  • 10
0
votes
0 answers

Handle IllegalArguemntException caused by type mismatched body argument in Spring controller

I have a Spring controller with two POST controller methods, that don't expect the same body type argument. One takes Employee typed argument, and the other takes Company typed; both parse them from XML body. I use…
0
votes
0 answers

Mapping external API json response value from a redirected html url to POJO

I am trying to get a json response value from a url : http://coverartarchive.org/release-group/2a0981fb-9593-3019-864b-ce934d97a16e which redirects to : https://ia800300.us.archive.org/0/items/mbid-cc8a35fc-ef70-40b5-b410-c1b5a029a866/index.json I…
Ruthless
  • 132
  • 3
  • 15
0
votes
1 answer

How do I retrieve Resource object using restTemplate in Spring Boot?

So, basically the title. I got 2 microservices. One generates and sends a zip file and the other one receives it, then does some magic, converts it to an array[] of bytes and then sends it somewhere else. But it's just in theory - I coldn't make it…
0
votes
0 answers

Cannot find a deserializer for non-concrete Map type [map type; class javafx.collections.ObservableMap, [simple type, class java.lang.Object]

I am getting this error when using Spring Boot Framework, RestTemplate and RestController. This error comes from the InvalidDefinitionException. I am not looking for an answer how to solve my problem, because I tried really everything. My question…
1
2