CXF:can't parse JSON. Raw result: No message body writer has been found for class java.util.HashMap, ContentType: application/json

55 Views Asked by At

Basically Trying to send the response with HashMap :Map<String, Object> with response entity

@GET
    @Path("/healthcheck")
    @ApiOperation(value = "Health Check", notes = "Http status code of 200 if app is healthy")
    public Response healthcheck();

Response from healthcheck is HashMap : Map<String,Object>

Dependencies added for CXF are CXF version :3.4.1

<dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-spring-boot-starter-jaxrs</artifactId>
            <version>3.4.1</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.jaxrs</groupId>
            <artifactId>jackson-jaxrs-json-provider</artifactId>
        </dependency>

        <!-- Swagger -->
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-rs-service-description</artifactId>
            <version>3.4.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-rs-service-description-swagger</artifactId>
            <version>3.4.1</version>
        </dependency>
        
        <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-rs-extension-providers</artifactId>
        <version>3.4.1</version>
    </dependency>

Would some one help to resolve this issue

0

There are 0 best solutions below