javarestjerseyunmarshallingmoxy

Restful - Moxy doesn't make unmarshalling properly in weblogic 14c


I have a rest web service which consumes JAXB annotated nested object as input as well as produces JAXB annotated nested object.

You can think of my nested objects like;

{
    "propertyOne": "bla bla",
    "propertyTwo": "5",
    objectB: {
        "propertyA": "xyz",
        "propertyB": "true"
    }

}

And my resource definition for web service like;

    @POST
    @Path("/abc")
    @Produces({ MediaType.APPLICATION_JSON })
    @Consumes({ MediaType.APPLICATION_JSON })
    public ObjectC search(ObjectA objectA) {
        // some logic
    }

This is a working structure with java1.8 on weblogic 12c. But after migration to java11 and weblogic 14c when I send a request to this web service I am receiving an empty objectA in my search resource like;

{
    "propertyOne": "",
    "propertyTwo": "",
    objectB: null
}

there is a unmarshalling problem, why is that? any idea...

NOT : library used from past I am using MOXY as JSON provider

        <dependency>
            <groupId>org.glassfish.jersey.media</groupId>
            <artifactId>jersey-media-moxy</artifactId>
            <scope>provided</scope>
        </dependency>

Solution

  • Paul's recommendation solved the issue, just put moxy in provided scope and register MoxyJsonFeature, it worked