Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 3630

org.springframework.http.converter.HttpMessageConversionException: Type definition error

$
0
0

I try return object with Resource and simple Object, but get error:

org.springframework.http.converter.HttpMessageConversionException:Type definition error: [simple type, classjava.io.BufferedInputStream]; nested exception iscom.fasterxml.jackson.databind.exc.InvalidDefinitionException: Noserializer found for class java.io.BufferedInputStream and noproperties discovered to create BeanSerializer (to avoid exception,disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through referencechain:ru.fabit.visor.ui.web.http.model.response.complexes.mobilecomplex.DeviceSummaryResponse["route"]->org.springframework.core.io.InputStreamResource["inputStream"])

Rest method:

@GetMapping(DEVICE_ID_PATH)    public ResponseEntity<DeviceSummaryResponse> getDeviceSummary(@PathVariable(name = "id") Long id) {        log.debug("REST request to get summary for complex with id = {}", id);        var deviceSummary = mobileComplexService.getSummary(id);        return ResponseEntity.ok().body(deviceSummaryMapper.toResponse(deviceSummary));    }

response Entity:

@Data@AllArgsConstructor@NoArgsConstructor@Builderpublic class DeviceSummaryResponse {    @ApiModelProperty(value = "Конфигурацияустройства", required = true)    private ConfigResponse config;    @ApiModelProperty(value = "GPX файлсмаршрутомустройства", required = true)    private Resource route;}

How can i return this object?


Viewing all articles
Browse latest Browse all 3630

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>