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

时间:2016-07-11 14:56:24

标签: java glassfish runtime-error

当我发送带有帖子的请求时,我收到此错误:

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

我的代码看起来像这样:

@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();
}

如果我将POST更改为GET方法,我会收到此错误:

NoClassDefFoundError: org/glassfish/jersey/client/ClientAsyncExecutorFactory

也许这些信息有助于某人......

1 个答案:

答案 0 :(得分:1)

您需要将以下依赖项添加到Maven项目

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