NoClassDefFoundError: org/glassfish/jersey/process

2019-09-10 20:41发布

问题:

I get this error when I send out a request with post:

NoClassDefFoundError: org/glassfish/jersey/process/internal/RequestExecutorFactory

my code looks like that:

@POST
@Path("/processPayment")
public Response processPay(PaymentRequestInterface request) throws ServletException {


    Object obj = new Object();

    //create an object at the used library and do something with it

    return Response.status(status).entity(obj).build();
}

and if I change my POST to a GET method I get this error:

NoClassDefFoundError: org/glassfish/jersey/client/ClientAsyncExecutorFactory

maybe this information helps someone....

回答1:

You need to add the following dependency to your Maven project

<dependency>
    <groupId>org.glassfish.jersey.core</groupId>
    <artifactId>jersey-client</artifactId>
    <version>2.23</version>
</dependency>