Я использую Mandrill и настроил интерфейс для пользователя с клиентом resteasy на Wildfly 18
public interface MandrillServiceRest extends ServiceRest {
@POST
@Path("/messages/send-template.json")
@Produces({MediaType.APPLICATION_JSON})
@Consumes({MediaType.APPLICATION_JSON})
Response sendTemplate(@HeaderParam("User-Agent") String userAgent, final MandrillSendTemplateRequest mandrillSendTemplateRequest);
@POST
@Path("/messages/send.json")
@Produces({MediaType.APPLICATION_JSON})
@Consumes({MediaType.APPLICATION_JSON})
Response send(@HeaderParam("User-Agent") String userAgent, final MandrillSendRequest mandrillSendRequest);
@POST
@Path("/users/ping2.json")
@Produces({MediaType.APPLICATION_JSON})
@Consumes({MediaType.APPLICATION_JSON})
MandrillPong ping(@HeaderParam("User-Agent") String userAgent, final MandrillPing mandrillPing);
@POST
@Path("/templates/info.json")
@Produces({MediaType.APPLICATION_JSON})
@Consumes({MediaType.APPLICATION_JSON})
Response templatesInfo(@HeaderParam("User-Agent") String userAgent, final MandrillTemplateInfoRequest mandrillTemplateInfoRequest);
@POST
@Path("/templates/add.json")
@Produces({MediaType.APPLICATION_JSON})
@Consumes({MediaType.APPLICATION_JSON})
Response addTemplate(@HeaderParam("User-Agent") String userAgent, final MandrillTemplateAddOrUpdateRequest mandrillTemplateAddOrUpdateRequest);
@POST
@Path("/templates/update.json")
@Produces({MediaType.APPLICATION_JSON})
@Consumes({MediaType.APPLICATION_JSON})
Response updateTemplate(@HeaderParam("User-Agent") String userAgent, final MandrillTemplateAddOrUpdateRequest mandrillTemplateAddOrUpdateRequest);
}
Кажется, но когда я создаю клиента:
ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance(); ResteasyProviderFactory.pushContext(javax.ws.rs.ext.Providers.class, factory);
ResteasyClientBuilder resteasyClientBuilder = new ResteasyClientBuilder().providerFactory(factory);
resteasyClientBuilder.connectionPoolSize(20);
resteasyClientBuilder.socketTimeout(5000, TimeUnit.SECONDS);
ResteasyClient resteasyClient = resteasyClientBuilder.build();
WebTarget target = resteasyClient.target("https://mandrillapp.com/api/1.0");
ResteasyWebTarget resteasyWebTarget = (ResteasyWebTarget) target;
MandrillServiceRest mandrillServiceRest = resteasyWebTarget.proxy(MandrillServiceRest.class);
и эта ошибка возникает:
org.jboss.resteasy.spi.LoggableFailure: RESTEASY003880: Unable to find contextual data of type: javax.servlet.ServletContext
В настоящее время я пытаюсь проверить новый пустой проект ...
Кстати, раньше он работал в wildfly 10