1

I have been using EWS(Exchange Web Service) for reading emails from a shared email box in Java 8.

After upgrading to Java 11 (Open JDK 11/Zulu Java 11), facing exceptions while reading emails.

This is the Exception:

java.lang.NoClassDefFoundError: javax/xml/ws/http/HTTPException at Microsoft.exchange.webservices.data.core.ExchangeService.internalFindFolders(ExchangeService.java:370) ~[ews-java-api-2.0.jar:na]

Guillaume F.
  • 5,905
  • 2
  • 31
  • 59
  • 5
    what exceptions? – Vivek Mangal Sep 16 '19 at 07:00
  • 1
    Welcome to Stack Overflow! Questions seeking debugging help ("**why isn't this code working?**") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it **in the question itself**. Questions without a **clear problem statement** are not useful to other readers. See: [How to create a Minimal, Reproducible example](https://stackoverflow.com/help/minimal-reproducible-example). – Draken Sep 16 '19 at 11:15
  • 1
    This is the Exception:: java.lang.NoClassDefFoundError: javax/xml/ws/http/HTTPException at microsoft.exchange.webservices.data.core.ExchangeService.internalFindFolders(ExchangeService.java:370) ~[ews-java-api-2.0.jar:na] at microsoft.exchange.webservices.data.core.ExchangeService.findFolders(ExchangeService.java:425) ~[ews-java-api-2.0.jar:na] caused by java.lang.ClassNotFoundException: javax.xml.ws.http.HTTPException – muneer ahmed Sep 18 '19 at 06:22

1 Answers1

5

Adding the below dependency in your pom.xml will help in reading emails from a shared mailbox.

<dependency>
    <groupId>javax.xml.ws</groupId>
    <artifactId>jaxws-api</artifactId>
    <version>2.2.1</version>
</dependency>
Draken
  • 3,134
  • 13
  • 34
  • 54