title: ews-java-api create new appointment
body: <p>I want to create a simple java program that creates a new appointment for my outlook calendar, but I don't know what went wrong.</p>
  
  <p>I also tried to send a simple email but it gives the same error.</p>
  
  <p>source code: <a href="https://github.com/OfficeDev/ews-java-api/wiki/Getting-Started-Guide" rel="nofollow noreferrer">https://github.com/OfficeDev/ews-java-api/wiki/Getting-Started-Guide</a></p>
  
  <pre><code>public class test {
      static class RedirectionUrlCallback implements IAutodiscoverRedirectionUrl {
          public boolean autodiscoverRedirectionUrlValidationCallback(
                  String redirectionUrl) {
              return redirectionUrl.toLowerCase().startsWith("https://");
          }
      }
      public static void main(String[] args){
          try {
              ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP2);
              ExchangeCredentials credentials = new WebCredentials("email@bc.ac.id", "password");
              service.setCredentials(credentials);
              service.autodiscoverUrl("email@bc.ac.id", new RedirectionUrlCallback());
              Appointment appointment = new Appointment(service);
              appointment.setSubject("Appointment for JAVA XML TEST");
              appointment.setBody(MessageBody.getMessageBodyFromText("Test Body Msg in JAVA"));
              SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
              Date startDate = formatter.parse("2019-04-16 12:00:00");
              Date endDate = formatter.parse("2019-04-16 13:00:00");
              appointment.setStart(startDate);//new Date(2010-1900,5-1,20,20,00));
              appointment.setEnd(endDate); //new Date(2010-1900,5-1,20,21,00));
              appointment.save();
          }
          catch (Exception e){
              System.out.println(e);
          }
      }
  }
  </code></pre>
  
  <p>Error code:</p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/ws/http/HTTPException
      at microsoft.exchange.webservices.data.core.ExchangeService.internalCreateItems(ExchangeService.java:593)
      at microsoft.exchange.webservices.data.core.ExchangeService.createItem(ExchangeService.java:657)
      at microsoft.exchange.webservices.data.core.service.item.Item.internalCreate(Item.java:245)
      at microsoft.exchange.webservices.data.core.service.item.Item.save(Item.java:386)
      at test.main(test.java:33)
  Caused by: java.lang.ClassNotFoundException: javax.xml.ws.http.HTTPException
     at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
     at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
     at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
     ... 5 more
  </code></pre>