This repository was archived by the owner on Jun 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 565
This repository was archived by the owner on Jun 18, 2024. It is now read-only.
ServiceRequestException: The request failed. 40 #371
Copy link
Copy link
Open
Labels
Description
When invoking the following code in 2 running threads:-
@Override
public Set<ExchangeAppointmentBean> query(final String calendarEmail,
final LocalDate startDate,
final LocalDate endDate) {
final ExchangeService service;
final FindItemsResults<Appointment> findResults;
final ExchangeCredentials credentials = new WebCredentials("user", "pwd");
try {
service = new ExchangeService(ExchangeVersion.Exchange2010_SP2);
service.setCredentials(credentials);
service.setUrl(new URI("https://hostname/ews/exchange.asmx"));
final FolderId folderId = new FolderId(WellKnownFolderName.Calendar, new Mailbox(calendarEmail));
final CalendarFolder calendarFolder = CalendarFolder.bind(service, folderId);
final CalendarView calendarView = new CalendarView(startDate.toDate(), endDate.toDate());
findResults = calendarFolder.findAppointments(calendarView);
}
catch (Exception e) {
throw CommonUtils.createException(LOGGER, e, "Unexpected error occurred when querying Exchange Server");
}
....
service.close();
}
... I get this error from the try-catch block:-
Caused by: microsoft.exchange.webservices.data.core.exception.service.remote.ServiceRequestException: The request failed. 40
at microsoft.exchange.webservices.data.core.request.SimpleServiceRequestBase.internalExecute(SimpleServiceRequestBase.java:74)
at microsoft.exchange.webservices.data.core.request.MultiResponseServiceRequest.execute(MultiResponseServiceRequest.java:158)
at microsoft.exchange.webservices.data.core.ExchangeService.bindToFolder(ExchangeService.java:500)
at microsoft.exchange.webservices.data.core.ExchangeService.bindToFolder(ExchangeService.java:519)
at microsoft.exchange.webservices.data.core.service.folder.CalendarFolder.bind(CalendarFolder.java:60)
at microsoft.exchange.webservices.data.core.service.folder.CalendarFolder.bind(CalendarFolder.java:75)
at myproject.module.pto.service.impl.MicrosoftExchangeServiceImpl.query(MicrosoftExchangeServiceImpl.java:78)
... 6 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 40
at org.apache.http.impl.auth.NTLMEngineImpl$NTLMMessage.addByte(NTLMEngineImpl.java:911)
at org.apache.http.impl.auth.NTLMEngineImpl$NTLMMessage.addULong(NTLMEngineImpl.java:940)
at org.apache.http.impl.auth.NTLMEngineImpl$Type1Message.getResponse(NTLMEngineImpl.java:1043)
at org.apache.http.impl.auth.NTLMEngineImpl.getType1Message(NTLMEngineImpl.java:148)
at org.apache.http.impl.auth.NTLMEngineImpl.generateType1Msg(NTLMEngineImpl.java:1628)
at org.apache.http.impl.auth.NTLMScheme.authenticate(NTLMScheme.java:139)
at org.apache.http.impl.auth.AuthSchemeBase.authenticate(AuthSchemeBase.java:138)
at org.apache.http.impl.auth.HttpAuthenticator.doAuth(HttpAuthenticator.java:239)
at org.apache.http.impl.auth.HttpAuthenticator.generateAuthResponse(HttpAuthenticator.java:202)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:262)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
at microsoft.exchange.webservices.data.core.request.HttpClientWebRequest.executeRequest(HttpClientWebRequest.java:292)
at microsoft.exchange.webservices.data.core.request.ServiceRequestBase.getEwsHttpWebResponse(ServiceRequestBase.java:720)
at microsoft.exchange.webservices.data.core.request.ServiceRequestBase.validateAndEmitRequest(ServiceRequestBase.java:639)
at microsoft.exchange.webservices.data.core.request.SimpleServiceRequestBase.internalExecute(SimpleServiceRequestBase.java:62)