apache tomcat v9.0 server at localhost failed to start
<p>Basically i have a java ee project configured with apache v9.0 and eclipse, based on research i had i found that gmail have a free smtp server that allows us to perform our mail services. now the problem is what when ever i input my smtp mail code to my project for sending a simple mail, apache pops an error saying:</p>

<blockquote>
  <p>Server Tomcat v9.0 Server at localhost failed to start?</p>
</blockquote>

<p>Apache logs:</p>

<pre><code>First file:
02-Sep-2016 09:03:21.045 INFO [main]      org.apache.catalina.startup.VersionLoggerListener.log Server version:             Apache Tomcat/9.0.0.M9
 02-Sep-2016 09:03:21.045 INFO [main]      org.apache.catalina.startup.VersionLoggerListener.log Server built:          Jul 4 2016 18:22:47 UTC
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:         9.0.0.0
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Windows 8
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            6.2
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          x86
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             C:\Program Files (x86)\Java\jre1.8.0_101
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_101-b13
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:              C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0\temp
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -     Djava.util.logging.config.file=C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0\conf\logging.properties
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: exit
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms128m
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx256m
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library 1.2.8 using APR version 1.5.2.
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
 02-Sep-2016 09:03:21.548 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized (OpenSSL 1.0.2h  3 May 2016)
 02-Sep-2016 09:03:23.095 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-30012"]
 02-Sep-2016 09:03:25.548 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
 02-Sep-2016 09:03:25.564 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-30013"]
 02-Sep-2016 09:03:25.564 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
 02-Sep-2016 09:03:25.564 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 8457 ms
 02-Sep-2016 09:03:25.814 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
 02-Sep-2016 09:03:25.814 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/9.0.0.M9
 02-Sep-2016 09:03:25.861 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0\webapps\docs
 02-Sep-2016 09:03:26.548 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0\webapps\docs has finished in 687 ms
 02-Sep-2016 09:03:26.548 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0\webapps\examples
 02-Sep-2016 09:03:28.142 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0\webapps\examples has finished in 1,594 ms
 02-Sep-2016 09:03:28.142 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0\webapps\host-manager
 02-Sep-2016 09:03:28.251 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0\webapps\host-manager has finished in 109 ms
 02-Sep-2016 09:03:28.251 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0\webapps\manager
 02-Sep-2016 09:03:28.267 INFO [localhost-startStop-1]      org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web      application directory C:\Program Files (x86)\Apache Software Foundation\Tomcat      9.0\webapps\manager has finished in 16 ms
 02-Sep-2016 09:03:28.267 INFO [localhost-startStop-1]      org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application      directory C:\Program Files (x86)\Apache Software Foundation\Tomcat      9.0\webapps\ROOT
 02-Sep-2016 09:03:28.314 INFO [localhost-startStop-1]           org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web      application directory C:\Program Files (x86)\Apache Software Foundation\Tomcat      9.0\webapps\ROOT has finished in 47 ms
 02-Sep-2016 09:03:28.314 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler [http-nio-30012]
 02-Sep-2016 09:03:28.439 INFO [main] org.apache.coyote.AbstractProtocol.start      Starting ProtocolHandler [ajp-nio-30013]
 02-Sep-2016 09:03:28.454 INFO [main] org.apache.catalina.startup.Catalina.start     Server startup in 2888 

 Second File:
 [2016-09-02 09:03:11] [info]  [ 3436] Commons Daemon procrun (1.0.15.0 32-bit) started
 [2016-09-02 09:03:11] [info]  [ 3436] Running 'Tomcat9' Service...
 [2016-09-02 09:03:12] [info]  [ 3468] Starting service...
 [2016-09-02 09:03:17] [info]  [ 3468] Service started in 5035 ms.

 Third File:
 02-Sep-2016 09:03:28.095 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log ContextListener: contextInitialized()
 02-Sep-2016 09:03:28.095 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log SessionListener: contextInitialized()

Fourth File:

 2016-09-02 09:03:11 Commons Daemon procrun stderr initialized
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:        Apache Tomcat/9.0.0.M9
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Jul 4 2016 18:22:47 UTC
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:         9.0.0.0
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Windows 8
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            6.2
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          x86
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             C:\Program Files (x86)\Java\jre1.8.0_101
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_101-b13
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0\temp
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0\conf\logging.properties
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: exit
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms128m
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx256m
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library 1.2.8 using APR version 1.5.2.
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
 02-Sep-2016 09:03:21.045 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
 02-Sep-2016 09:03:21.548 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized (OpenSSL 1.0.2h  3 May 2016)
 02-Sep-2016 09:03:23.095 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-30012"]
 02-Sep-2016 09:03:25.548 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
 02-Sep-2016 09:03:25.564 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-30013"]
 02-Sep-2016 09:03:25.564 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
 02-Sep-2016 09:03:25.564 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 8457 ms
 02-Sep-2016 09:03:25.814 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
 02-Sep-2016 09:03:25.814 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/9.0.0.M9
 02-Sep-2016 09:03:25.861 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0\webapps\docs
 02-Sep-2016 09:03:26.548 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0\webapps\docs has finished in 687 ms
 02-Sep-2016 09:03:26.548 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0\webapps\examples
 02-Sep-2016 09:03:28.142 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0\webapps\examples has finished in 1,594 ms
 02-Sep-2016 09:03:28.142 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0\webapps\host-manager
 02-Sep-2016 09:03:28.251 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0\webapps\host-manager has finished in 109 ms
 02-Sep-2016 09:03:28.251 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0\webapps\manager
 02-Sep-2016 09:03:28.267 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0\webapps\manager has finished in 16 ms
 02-Sep-2016 09:03:28.267 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0\webapps\ROOT
 02-Sep-2016 09:03:28.314 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0\webapps\ROOT has finished in 47 ms
 02-Sep-2016 09:03:28.314 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler [http-nio-30012]
 02-Sep-2016 09:03:28.439 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler [ajp-nio-30013]
 02-Sep-2016 09:03:28.454 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 2888 ms

Last File Log:
2016-09-02 09:03:11 Commons Daemon procrun stdout initialized
</code></pre>

<p>here is my smtp implementation code:</p>

<pre><code>package duck.reg.pack;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import java.util.Properties;

import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;

@WebServlet("/sendmailtls")
public class SendMailTLS extends HttpServlet {
public static void main() {

    final String username = "hello@gmail.com";
    final String password = "MYPassword";

    Properties props = new Properties();
    props.put("mail.smtp.auth", "true");
    props.put("mail.smtp.starttls.enable", "true");
    props.put("mail.smtp.host", "smtp.gmail.com");
    props.put("mail.smtp.port", "587");

    Session session = Session.getInstance(props,
      new javax.mail.Authenticator() {
        protected PasswordAuthentication getPasswordAuthentication() {
            return new PasswordAuthentication(username, password);
        }
      });

    try {

        Message message = new MimeMessage(session);
        message.setFrom(new InternetAddress("myemail@gmail.com"));
        message.setRecipients(Message.RecipientType.TO,
            InternetAddress.parse("myemail@yahoo.com"));
        message.setSubject("Testing Subject");
        message.setText("Dear Mail Crawler,"
            + "\n\n No spam to my email, please!");

        Transport.send(message);

        System.out.println("Done");

    } catch (MessagingException e) {
        throw new RuntimeException(e);
    }
}
}
</code></pre>

<p>My Web.xml File:</p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"    xmlns="http://xmlns.jcp.org/xml/ns/javaee"    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee     http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID"     version="3.1"&gt;
&lt;display-name&gt;Duck&lt;/display-name&gt;
&lt;welcome-file-list&gt;
 &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
 &lt;welcome-file&gt;index.htm&lt;/welcome-file&gt;
 &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
 &lt;welcome-file&gt;default.html&lt;/welcome-file&gt;
 &lt;welcome-file&gt;default.htm&lt;/welcome-file&gt;
 &lt;welcome-file&gt;default.jsp&lt;/welcome-file&gt;
 &lt;/welcome-file-list&gt;
&lt;/web-app&gt;
</code></pre>