8 Replies Latest reply on Jul 29, 2015 10:24 AM by Tomaz Cerar

    javax.mail API is not working with Wildfly9.0.0.Final Release

    Kiran Kumar Newbie

      Handshake is failing for the mail session and it keep on requesting. I am making use of mtp.gmail.com on port 465 without SSL. It was working in Wildfly8 and With Wildfly 9. Mail is not going through my application. And all the authentication and smtp connection will happen in code only. Not on server mail session settings. Please see my trace below.But its showing fine  log.


      2015-07-28 15:30:40,166 DEBUG [org.directwebremoting.log.session] (default task-18) Creating DefaultScriptSession[id=Kkv5/QMM7] on /showempjob.htm

      2015-07-28 15:30:40,183 DEBUG [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (default task-18) SmartPoolD: getConnection(null, WrappedConnectionRequestInfo@1c4fc564[userName=admsh]) [0/30]

      2015-07-28 15:30:40,496 DEBUG [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (default task-18) SmartPoolD: returnConnection(75772d75, false) [0/30]

      2015-07-28 15:30:40,520 DEBUG [class com.bodhtree.nexus.util.mail.Mail] (default task-18) I came

      2015-07-28 15:30:40,521 DEBUG [class com.bodhtree.nexus.util.mail.Mail] (default task-18) I set

      2015-07-28 15:30:40,537 CONFIG [javax.mail] (default task-18) JavaMail version 1.5.3

      2015-07-28 15:30:40,550 CONFIG [javax.mail] (default task-18) successfully loaded resource: /META-INF/javamail.default.providers

      2015-07-28 15:30:40,550 CONFIG [javax.mail] (default task-18) Tables of loaded providers

      2015-07-28 15:30:40,551 CONFIG [javax.mail] (default task-18) Providers Listed By Class Name: {com.sun.mail.smtp.SMTPSSLTransport=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc], com.sun.mail.imap.IMAPSSLStore=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3SSLStore=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], com.sun.mail.imap.IMAPStore=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc]}

      2015-07-28 15:30:40,551 CONFIG [javax.mail] (default task-18) Providers Listed By Protocol: {imaps=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], smtps=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc], pop3s=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]}

      2015-07-28 15:30:40,553 CONFIG [javax.mail] (default task-18) successfully loaded resource: /META-INF/javamail.default.address.map

      2015-07-28 15:30:40,597 DEBUG [class com.bodhtree.nexus.util.mail.Mail] (default task-18) TO : kiiranumarkv@gmail.com

      2015-07-28 15:30:40,597 DEBUG [class com.bodhtree.nexus.util.mail.Mail] (default task-18) ccAddresses :

      2015-07-28 15:30:40,597 DEBUG [class com.bodhtree.nexus.util.mail.Mail] (default task-18) bccAddresses :

      2015-07-28 15:30:40,598 DEBUG [class com.bodhtree.nexus.util.mail.Mail] (default task-18) messagesender : support@smarthires.com

      2015-07-28 15:30:40,598 DEBUG [class com.bodhtree.nexus.util.mail.Mail] (default task-18) I subjectFriend recommends "Admin" opening at "ALECTO HEALTHCARE"

      2015-07-28 15:30:40,612 DEBUG [class com.bodhtree.nexus.util.mail.Mail] (default task-18) Message: javax.mail.internet.MimeMessage@3f2bde8b

      2015-07-28 15:30:40,624 FINE  [javax.activation] (default task-18) MailcapCommandMap: load HOME

      2015-07-28 15:30:40,626 FINE  [javax.activation] (default task-18) new MailcapFile: file C:\Users\kiran.MAHATHI\.mailcap

      2015-07-28 15:30:40,626 FINE  [javax.activation] (default task-18) MailcapCommandMap: load SYS

      2015-07-28 15:30:40,627 FINE  [javax.activation] (default task-18) new MailcapFile: file C:\Program Files\Java\jdk1.8.0_45\jre\lib\mailcap

      2015-07-28 15:30:40,627 FINE  [javax.activation] (default task-18) MailcapCommandMap: load JAR

      2015-07-28 15:30:40,628 FINE  [javax.activation] (default task-18) MailcapCommandMap: getResources

      2015-07-28 15:30:40,629 FINE  [javax.activation] (default task-18) MailcapCommandMap: URL vfs:/C:/Work/wildfly-9.0.0.Final/bin/content/SmarthiresMaven.war/WEB-INF/lib/mail-1.4.jar/META-INF/mailcap

      2015-07-28 15:30:40,629 FINE  [javax.activation] (default task-18) new MailcapFile: InputStream

      2015-07-28 15:30:40,630 FINE  [javax.activation] (default task-18) parse: text/plain;; x-java-content-handler=com.sun.mail.handlers.text_plain

      2015-07-28 15:30:40,630 FINE  [javax.activation] (default task-18)   Type: text/plain

      2015-07-28 15:30:40,630 FINE  [javax.activation] (default task-18)     Command: content-handler, Class: com.sun.mail.handlers.text_plain

      2015-07-28 15:30:40,631 FINE  [javax.activation] (default task-18) parse: text/html;; x-java-content-handler=com.sun.mail.handlers.text_html

      2015-07-28 15:30:40,631 FINE  [javax.activation] (default task-18)   Type: text/html

      2015-07-28 15:30:40,631 FINE  [javax.activation] (default task-18)     Command: content-handler, Class: com.sun.mail.handlers.text_html

      2015-07-28 15:30:40,631 FINE  [javax.activation] (default task-18) parse: text/xml;; x-java-content-handler=com.sun.mail.handlers.text_xml

      2015-07-28 15:30:40,631 FINE  [javax.activation] (default task-18)   Type: text/xml

      2015-07-28 15:30:40,631 FINE  [javax.activation] (default task-18)     Command: content-handler, Class: com.sun.mail.handlers.text_xml

      2015-07-28 15:30:40,632 FINE  [javax.activation] (default task-18) parse: multipart/*;; x-java-content-handler=com.sun.mail.handlers.multipart_mixed; x-java-fallback-entry=true

      2015-07-28 15:30:40,632 FINE  [javax.activation] (default task-18)   Type: multipart/*

      2015-07-28 15:30:40,632 FINE  [javax.activation] (default task-18)     Command: content-handler, Class: com.sun.mail.handlers.multipart_mixed

      2015-07-28 15:30:40,632 FINE  [javax.activation] (default task-18) parse: message/rfc822;; x-java-content-handler=com.sun.mail.handlers.message_rfc822

      2015-07-28 15:30:40,632 FINE  [javax.activation] (default task-18)   Type: message/rfc822

      2015-07-28 15:30:40,632 FINE  [javax.activation] (default task-18)     Command: content-handler, Class: com.sun.mail.handlers.message_rfc822

      2015-07-28 15:30:40,632 FINE  [javax.activation] (default task-18) MailcapCommandMap: successfully loaded mailcap file from URL: vfs:/C:/Work/wildfly-9.0.0.Final/bin/content/SmarthiresMaven.war/WEB-INF/lib/mail-1.4.jar/META-INF/mailcap

      2015-07-28 15:30:40,633 FINE  [javax.activation] (default task-18) MailcapCommandMap: load DEF

      2015-07-28 15:30:40,633 FINE  [javax.activation] (default task-18) new MailcapFile: InputStream

      2015-07-28 15:30:40,633 FINE  [javax.activation] (default task-18) parse: image/gif;; x-java-view=com.sun.activation.viewers.ImageViewer

      2015-07-28 15:30:40,634 FINE  [javax.activation] (default task-18)   Type: image/gif

      2015-07-28 15:30:40,634 FINE  [javax.activation] (default task-18)     Command: view, Class: com.sun.activation.viewers.ImageViewer

      2015-07-28 15:30:40,634 FINE  [javax.activation] (default task-18) parse: image/jpeg;; x-java-view=com.sun.activation.viewers.ImageViewer

      2015-07-28 15:30:40,634 FINE  [javax.activation] (default task-18)   Type: image/jpeg

      2015-07-28 15:30:40,635 FINE  [javax.activation] (default task-18)     Command: view, Class: com.sun.activation.viewers.ImageViewer

      2015-07-28 15:30:40,635 FINE  [javax.activation] (default task-18) parse: text/*;; x-java-view=com.sun.activation.viewers.TextViewer

      2015-07-28 15:30:40,635 FINE  [javax.activation] (default task-18)   Type: text/*

      2015-07-28 15:30:40,635 FINE  [javax.activation] (default task-18)     Command: view, Class: com.sun.activation.viewers.TextViewer

      2015-07-28 15:30:40,636 FINE  [javax.activation] (default task-18) parse: text/*;; x-java-edit=com.sun.activation.viewers.TextEditor

      2015-07-28 15:30:40,636 FINE  [javax.activation] (default task-18)   Type: text/*

      2015-07-28 15:30:40,636 FINE  [javax.activation] (default task-18)     Command: edit, Class: com.sun.activation.viewers.TextEditor

      2015-07-28 15:30:40,636 FINE  [javax.activation] (default task-18) Merging commands for type text/*

      2015-07-28 15:30:40,637 FINE  [javax.activation] (default task-18) MailcapCommandMap: successfully loaded mailcap file: /META-INF/mailcap.default

      2015-07-28 15:30:40,637 FINE  [javax.activation] (default task-18) MailcapCommandMap: createDataContentHandler for text/html

      2015-07-28 15:30:40,637 FINE  [javax.activation] (default task-18)   search DB #1

      2015-07-28 15:30:40,637 FINE  [javax.activation] (default task-18)     got content-handler

      2015-07-28 15:30:40,637 FINE  [javax.activation] (default task-18)       class com.sun.mail.handlers.text_html

      2015-07-28 15:30:40,674 FINE  [javax.mail] (default task-18) getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]

      2015-07-28 15:30:40,696 FINE  [com.sun.mail.smtp] (default task-18) need username and password for authentication

      2015-07-28 15:30:40,697 FINE  [com.sun.mail.smtp] (default task-18) useEhlo true, useAuth true

      2015-07-28 15:30:40,698 FINE  [com.sun.mail.smtp] (default task-18) trying to connect to host "smtp.gmail.com", port 465, isSSL false

      2015-07-28 15:31:57,673 DEBUG [org.jboss.ejb.client.txn] (Periodic Recovery) Send recover request for transaction origin node identifier 1 to EJB receiver with node name kirankumar

      2015-07-28 15:32:07,676 DEBUG [org.jboss.ejb.client.txn] (Periodic Recovery) Send recover request for transaction origin node identifier 1 to EJB receiver with node name kirankumar

       

       

      And my mail function is

       

      public void sendMail(String toAddresses, String ccAddresses, String bccAddresses, mailLogin from, String subject, String body, String type) {

        Transport bus = null;

              try {    

              Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());

              String mailhost= "smtp.gmail.com";  

          Properties props = new Properties();

          props.setProperty("mail.transport.protocol", "smtp");

          props.setProperty("mail.host", mailhost);

          props.put("mail.smtp.auth", "true");

          props.put("mail.smtp.port", "465");

          props.put("mail.smtp.socketFactory.port", "465");

          props.put("mail.smtp.socketFactory.class",

          "javax.net.ssl.SSLSocketFactory");

          props.put("mail.smtp.socketFactory.fallback", "false");

          props.setProperty("mail.smtp.quitwait", "false");

       

          final String uName = "example@yahoo.com";

          final String uPass = "mypasss1233";

       

          Session session = Session.getInstance(props,

          new javax.mail.Authenticator()

          {

          protected PasswordAuthentication getPasswordAuthentication()

          { return new PasswordAuthentication(uName,uPass); }

          });

         

          MimeMessage message = new MimeMessage(session);

          message.setSender(new InternetAddress(uName));

         

          message.setSubject(subject);

          message.setContent(body, "text/html; charset=UTF-8");

          message.setRecipients(Message.RecipientType.TO,toAddresses);    

          if(null!=ccAddresses && !("").equals(ccAddresses)){

          message.setRecipients(Message.RecipientType.CC, ccAddresses);  

          }if(null!=bccAddresses && !("").equals(bccAddresses))

          message.setRecipients(Message.RecipientType.BCC, bccAddresses);

          sendMailByTrasport(message);

       

       

        } catch (MessagingException mex) {

        mex.printStackTrace();

        logger.logError(mex.toString());

              } catch(Exception e) {

              logger.logError(e.toString());

        e.printStackTrace();

        }

        }


      private void sendMailByTrasport(final MimeMessage message) throws MessagingException{

        Transport.send(message);

      }



      And I am running my Wildfly 9 in HA mode and my stadalone-ha.xml as given below.


      <?xml version='1.0' encoding='UTF-8'?>

       

       

      <server xmlns="urn:jboss:domain:3.0">

       

       

          <extensions>

              <extension module="org.jboss.as.clustering.infinispan"/>

              <extension module="org.jboss.as.clustering.jgroups"/>

              <extension module="org.jboss.as.connector"/>

              <extension module="org.jboss.as.deployment-scanner"/>

              <extension module="org.jboss.as.ee"/>

              <extension module="org.jboss.as.ejb3"/>

              <extension module="org.jboss.as.jaxrs"/>

              <extension module="org.jboss.as.jdr"/>

              <extension module="org.jboss.as.jmx"/>

              <extension module="org.jboss.as.jpa"/>

              <extension module="org.jboss.as.jsf"/>

              <extension module="org.jboss.as.logging"/>

              <extension module="org.jboss.as.mail"/>

              <extension module="org.jboss.as.modcluster"/>

              <extension module="org.jboss.as.naming"/>

              <extension module="org.jboss.as.pojo"/>

              <extension module="org.jboss.as.remoting"/>

              <extension module="org.jboss.as.sar"/>

              <extension module="org.jboss.as.security"/>

              <extension module="org.jboss.as.transactions"/>

              <extension module="org.jboss.as.webservices"/>

              <extension module="org.jboss.as.weld"/>

              <extension module="org.wildfly.extension.batch"/>

              <extension module="org.wildfly.extension.bean-validation"/>

              <extension module="org.wildfly.extension.io"/>

              <extension module="org.wildfly.extension.request-controller"/>

              <extension module="org.wildfly.extension.security.manager"/>

              <extension module="org.wildfly.extension.undertow"/>

          </extensions>

       

       

       

       

          <management>

              <security-realms>

                  <security-realm name="ManagementRealm">

                      <authentication>

                          <local default-user="$local" skip-group-loading="true"/>

                          <properties path="mgmt-users.properties" relative-to="jboss.server.config.dir"/>

                      </authentication>

                      <authorization map-groups-to-roles="false">

                          <properties path="mgmt-groups.properties" relative-to="jboss.server.config.dir"/>

                      </authorization>

                  </security-realm>

                  <security-realm name="ApplicationRealm">

                      <authentication>

                          <local default-user="$local" allowed-users="*" skip-group-loading="true"/>

                          <properties path="application-users.properties" relative-to="jboss.server.config.dir"/>

                      </authentication>

                      <authorization>

                          <properties path="application-roles.properties" relative-to="jboss.server.config.dir"/>

                      </authorization>

                  </security-realm>

              </security-realms>

              <audit-log>

                  <formatters>

                      <json-formatter name="json-formatter"/>

                  </formatters>

                  <handlers>

                      <file-handler name="file" formatter="json-formatter" path="audit-log.log" relative-to="jboss.server.data.dir"/>

                  </handlers>

                  <logger log-boot="true" log-read-only="false" enabled="false">

                      <handlers>

                          <handler name="file"/>

                      </handlers>

                  </logger>

              </audit-log>

              <management-interfaces>

                  <http-interface security-realm="ManagementRealm" http-upgrade-enabled="true">

                      <socket-binding http="management-http"/>

                  </http-interface>

              </management-interfaces>

              <access-control provider="simple">

                  <role-mapping>

                      <role name="SuperUser">

                          <include>

                              <user name="$local"/>

                          </include>

                      </role>

                  </role-mapping>

              </access-control>

          </management>

       

       

          <profile>

              <subsystem xmlns="urn:jboss:domain:logging:3.0">

                  <console-handler name="CONSOLE">

                      <level name="INFO"/>

                      <formatter>

                          <named-formatter name="COLOR-PATTERN"/>

                      </formatter>

                  </console-handler>

                  <periodic-rotating-file-handler name="FILE" autoflush="true">

                      <formatter>

                          <named-formatter name="PATTERN"/>

                      </formatter>

                      <file relative-to="jboss.server.log.dir" path="server.log"/>

                      <suffix value=".yyyy-MM-dd"/>

                      <append value="true"/>

                  </periodic-rotating-file-handler>

                  <logger category="com.arjuna">

                      <level name="WARN"/>

                  </logger>

                  <logger category="org.apache.tomcat.util.modeler">

                      <level name="WARN"/>

                  </logger>

                  <logger category="org.jboss.as.config">

                      <level name="DEBUG"/>

                  </logger>

                  <logger category="sun.rmi">

                      <level name="WARN"/>

                  </logger>

                  <logger category="jacorb">

                      <level name="WARN"/>

                  </logger>

                  <logger category="jacorb.config">

                      <level name="ERROR"/>

                  </logger>

                  <root-logger>

                      <level name="INFO"/>

                      <handlers>

                          <handler name="CONSOLE"/>

                          <handler name="FILE"/>

                      </handlers>

                  </root-logger>

                  <formatter name="PATTERN">

                      <pattern-formatter pattern="%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/>

                  </formatter>

                  <formatter name="COLOR-PATTERN">

                      <pattern-formatter pattern="%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/>

                  </formatter>

              </subsystem>

              <subsystem xmlns="urn:jboss:domain:batch:1.0">

                  <job-repository>

                      <in-memory/>

                  </job-repository>

                  <thread-pool>

                      <max-threads count="10"/>

                      <keepalive-time time="30" unit="seconds"/>

                  </thread-pool>

              </subsystem>

              <subsystem xmlns="urn:jboss:domain:bean-validation:1.0"/>

              <subsystem xmlns="urn:jboss:domain:datasources:3.0">

                  <datasources>

                      <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">

                          <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>

                          <driver>h2</driver>

                          <security>

                              <user-name>sa</user-name>

                              <password>sa</password>

                          </security>

                      </datasource>

                      <datasource jndi-name="java:jboss/datasources/nexusdb" pool-name="SmartPoolD" enabled="true">

                          <connection-url>jdbc:mysql://localhost:3306/mytestdb</connection-url>

                          <driver>mysql</driver>

                          <pool>

                              <max-pool-size>30</max-pool-size>

                          </pool>

                          <security>

                              <user-name>root</user-name>

                              <password>omypass@#</password>

                          </security>

                      </datasource>

                      <drivers>

                          <driver name="mysql" module="com.mysql">

                              <driver-class>com.mysql.jdbc.Driver</driver-class>

                          </driver>

                          <driver name="h2" module="com.h2database.h2">

                              <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>

                          </driver>

                      </drivers>

                  </datasources>

              </subsystem>

              <subsystem xmlns="urn:jboss:domain:deployment-scanner:2.0">

                  <deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000" runtime-failure-causes-rollback="${jboss.deployment.scanner.rollback.on.failure:false}"/>

              </subsystem>

              <subsystem xmlns="urn:jboss:domain:ee:3.0">

                  <spec-descriptor-property-replacement>false</spec-descriptor-property-replacement>

                  <concurrent>

                      <context-services>

                          <context-service name="default" jndi-name="java:jboss/ee/concurrency/context/default" use-transaction-setup-provider="true"/>

                      </context-services>

                      <managed-thread-factories>

                          <managed-thread-factory name="default" jndi-name="java:jboss/ee/concurrency/factory/default" context-service="default"/>

                      </managed-thread-factories>

                      <managed-executor-services>

                          <managed-executor-service name="default" jndi-name="java:jboss/ee/concurrency/executor/default" context-service="default" hung-task-threshold="60000" core-threads="5" max-threads="25" keepalive-time="5000"/>

                      </managed-executor-services>

                      <managed-scheduled-executor-services>

                          <managed-scheduled-executor-service name="default" jndi-name="java:jboss/ee/concurrency/scheduler/default" context-service="default" hung-task-threshold="60000" core-threads="2" keepalive-time="3000"/>

                      </managed-scheduled-executor-services>

                  </concurrent>

                  <default-bindings context-service="java:jboss/ee/concurrency/context/default" datasource="java:jboss/datasources/ExampleDS" managed-executor-service="java:jboss/ee/concurrency/executor/default" managed-scheduled-executor-service="java:jboss/ee/concurrency/scheduler/default" managed-thread-factory="java:jboss/ee/concurrency/factory/default"/>

              </subsystem>

              <subsystem xmlns="urn:jboss:domain:ejb3:3.0">

                  <session-bean>

                      <stateful default-access-timeout="5000" cache-ref="distributable" passivation-disabled-cache-ref="simple"/>

                      <singleton default-access-timeout="5000"/>

                  </session-bean>

                  <pools>

                      <bean-instance-pools>

                          <strict-max-pool name="slsb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>

                          <strict-max-pool name="mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>

                      </bean-instance-pools>

                  </pools>

                  <caches>

                      <cache name="simple"/>

                      <cache name="distributable" passivation-store-ref="infinispan" aliases="passivating clustered"/>

                  </caches>

                  <passivation-stores>

                      <passivation-store name="infinispan" cache-container="ejb" max-size="10000"/>

                  </passivation-stores>

                  <async thread-pool-name="default"/>

                  <timer-service thread-pool-name="default" default-data-store="default-file-store">

                      <data-stores>

                          <file-data-store name="default-file-store" path="timer-service-data" relative-to="jboss.server.data.dir"/>

                      </data-stores>

                  </timer-service>

                  <remote connector-ref="http-remoting-connector" thread-pool-name="default"/>

                  <thread-pools>

                      <thread-pool name="default">

                          <max-threads count="10"/>

                          <keepalive-time time="100" unit="milliseconds"/>

                      </thread-pool>

                  </thread-pools>

                  <default-security-domain value="other"/>

                  <default-missing-method-permissions-deny-access value="true"/>

                  <log-system-exceptions value="true"/>

              </subsystem>

              <subsystem xmlns="urn:jboss:domain:io:1.1">

                  <worker name="default"/>

                  <buffer-pool name="default"/>

              </subsystem>

              <subsystem xmlns="urn:jboss:domain:infinispan:3.0">

                  <cache-container name="server" default-cache="default" module="org.wildfly.clustering.server" aliases="singleton cluster">

                      <transport lock-timeout="60000"/>

                      <replicated-cache name="default" mode="SYNC">

                          <transaction mode="BATCH"/>

                      </replicated-cache>

                  </cache-container>

                  <cache-container name="web" default-cache="dist" module="org.wildfly.clustering.web.infinispan">

                      <transport lock-timeout="60000"/>

                      <distributed-cache name="dist" mode="ASYNC" owners="2" l1-lifespan="0">

                          <locking isolation="REPEATABLE_READ"/>

                          <transaction mode="BATCH"/>

                          <file-store/>

                      </distributed-cache>

                  </cache-container>

                  <cache-container name="ejb" default-cache="dist" module="org.wildfly.clustering.ejb.infinispan" aliases="sfsb">

                      <transport lock-timeout="60000"/>

                      <distributed-cache name="dist" mode="ASYNC" owners="2" l1-lifespan="0">

                          <locking isolation="REPEATABLE_READ"/>

                          <transaction mode="BATCH"/>

                          <file-store/>

                      </distributed-cache>

                  </cache-container>

                  <cache-container name="hibernate" default-cache="local-query" module="org.hibernate.infinispan">

                      <transport lock-timeout="60000"/>

                      <local-cache name="local-query">

                          <eviction strategy="LRU" max-entries="10000"/>

                          <expiration max-idle="100000"/>

                      </local-cache>

                      <invalidation-cache name="entity" mode="SYNC">

                          <transaction mode="NON_XA"/>

                          <eviction strategy="LRU" max-entries="10000"/>

                          <expiration max-idle="100000"/>

                      </invalidation-cache>

                      <replicated-cache name="timestamps" mode="ASYNC"/>

                  </cache-container>

              </subsystem>

              <subsystem xmlns="urn:jboss:domain:jaxrs:1.0"/>

              <subsystem xmlns="urn:jboss:domain:jca:3.0">

                  <archive-validation enabled="true" fail-on-error="true" fail-on-warn="false"/>

                  <bean-validation enabled="true"/>

                  <default-workmanager>

                      <short-running-threads>

                          <core-threads count="50"/>

                          <queue-length count="50"/>

                          <max-threads count="50"/>

                          <keepalive-time time="10" unit="seconds"/>

                      </short-running-threads>

                      <long-running-threads>

                          <core-threads count="50"/>

                          <queue-length count="50"/>

                          <max-threads count="50"/>

                          <keepalive-time time="10" unit="seconds"/>

                      </long-running-threads>

                  </default-workmanager>

                  <cached-connection-manager/>

              </subsystem>

              <subsystem xmlns="urn:jboss:domain:jdr:1.0"/>

              <subsystem xmlns="urn:jboss:domain:jgroups:3.0">

                  <channels default="ee">

                      <channel name="ee"/>

                  </channels>

                  <stacks default="udp">

                      <stack name="udp">

                          <transport type="UDP" socket-binding="jgroups-udp"/>

                          <protocol type="PING"/>

                          <protocol type="MERGE3"/>

                          <protocol type="FD_SOCK" socket-binding="jgroups-udp-fd"/>

                          <protocol type="FD_ALL"/>

                          <protocol type="VERIFY_SUSPECT"/>

                          <protocol type="pbcast.NAKACK2"/>

                          <protocol type="UNICAST3"/>

                          <protocol type="pbcast.STABLE"/>

                          <protocol type="pbcast.GMS"/>

                          <protocol type="UFC"/>

                          <protocol type="MFC"/>

                          <protocol type="FRAG2"/>

                          <protocol type="RSVP"/>

                      </stack>

                      <stack name="tcp">

                          <transport type="TCP" socket-binding="jgroups-tcp"/>

                          <protocol type="MPING" socket-binding="jgroups-mping"/>

                          <protocol type="MERGE3"/>

                          <protocol type="FD_SOCK" socket-binding="jgroups-tcp-fd"/>

                          <protocol type="FD"/>

                          <protocol type="VERIFY_SUSPECT"/>

                          <protocol type="pbcast.NAKACK2"/>

                          <protocol type="UNICAST3"/>

                          <protocol type="pbcast.STABLE"/>

                          <protocol type="pbcast.GMS"/>

                          <protocol type="MFC"/>

                          <protocol type="FRAG2"/>

                          <protocol type="RSVP"/>

                      </stack>

                  </stacks>

              </subsystem>

              <subsystem xmlns="urn:jboss:domain:jmx:1.3">

                  <expose-resolved-model/>

                  <expose-expression-model/>

                  <remoting-connector/>

              </subsystem>

              <subsystem xmlns="urn:jboss:domain:jpa:1.1">

                  <jpa default-datasource="" default-extended-persistence-inheritance="DEEP"/>

              </subsystem>

              <subsystem xmlns="urn:jboss:domain:jsf:1.0"/>

              <subsystem xmlns="urn:jboss:domain:mail:2.0">

                  <mail-session name="default" jndi-name="java:jboss/mail/Default">

                      <smtp-server outbound-socket-binding-ref="mail-smtp"/>

                  </mail-session>

              </subsystem>

              <subsystem xmlns="urn:jboss:domain:modcluster:2.0">

                  <mod-cluster-config advertise-socket="modcluster" connector="ajp">

                      <dynamic-load-provider>

                          <load-metric type="cpu"/>

                      </dynamic-load-provider>

                  </mod-cluster-config>

              </subsystem>

              <subsystem xmlns="urn:jboss:domain:naming:2.0">

                  <remote-naming/>

              </subsystem>

              <subsystem xmlns="urn:jboss:domain:pojo:1.0"/>

              <subsystem xmlns="urn:jboss:domain:remoting:3.0">

                  <endpoint worker="default"/>

                  <http-connector name="http-remoting-connector" connector-ref="default" security-realm="ApplicationRealm"/>

              </subsystem>

              <subsystem xmlns="urn:jboss:domain:resource-adapters:3.0"/>

              <subsystem xmlns="urn:jboss:domain:request-controller:1.0"/>

              <subsystem xmlns="urn:jboss:domain:sar:1.0"/>

              <subsystem xmlns="urn:jboss:domain:security-manager:1.0">

                  <deployment-permissions>

                      <maximum-set>

                          <permission class="java.security.AllPermission"/>

                      </maximum-set>

                  </deployment-permissions>

              </subsystem>

              <subsystem xmlns="urn:jboss:domain:security:1.2">

                  <security-domains>

                      <security-domain name="other" cache-type="default">

                          <authentication>

                              <login-module code="Remoting" flag="optional">

                                  <module-option name="password-stacking" value="useFirstPass"/>

                              </login-module>

                              <login-module code="RealmDirect" flag="required">

                                  <module-option name="password-stacking" value="useFirstPass"/>

                              </login-module>

                          </authentication>

                      </security-domain>

                      <security-domain name="jboss-web-policy" cache-type="default">

                          <authorization>

                              <policy-module code="Delegating" flag="required"/>

                          </authorization>

                      </security-domain>

                      <security-domain name="jboss-ejb-policy" cache-type="default">

                          <authorization>

                              <policy-module code="Delegating" flag="required"/>

                          </authorization>

                      </security-domain>

                  </security-domains>

              </subsystem>

              <subsystem xmlns="urn:jboss:domain:transactions:3.0">

                  <core-environment>

                      <process-id>

                          <uuid/>

                      </process-id>

                  </core-environment>

                  <recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/>

              </subsystem>

              <subsystem xmlns="urn:jboss:domain:undertow:2.0">

                  <buffer-cache name="default"/>

                  <server name="default-server">

                      <ajp-listener name="ajp" socket-binding="ajp"/>

                      <http-listener name="default" socket-binding="http" redirect-socket="https"/>

                      <host name="default-host" alias="localhost">

                          <location name="/" handler="welcome-content"/>

                          <filter-ref name="server-header"/>

                          <filter-ref name="x-powered-by-header"/>

                      </host>

                  </server>

                  <servlet-container name="default">

                      <jsp-config/>

                      <session-cookie http-only="false" secure="false"/>

                      <websockets/>

                  </servlet-container>

                  <handlers>

                      <file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>

                  </handlers>

                  <filters>

                      <response-header name="server-header" header-name="Server" header-value="WildFly/9"/>

                      <response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/>

                  </filters>

              </subsystem>

              <subsystem xmlns="urn:jboss:domain:webservices:2.0">

                  <wsdl-host>${jboss.bind.address:127.0.0.1}</wsdl-host>

                  <endpoint-config name="Standard-Endpoint-Config"/>

                  <endpoint-config name="Recording-Endpoint-Config">

                      <pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM">

                          <handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/>

                      </pre-handler-chain>

                  </endpoint-config>

                  <client-config name="Standard-Client-Config"/>

              </subsystem>

              <subsystem xmlns="urn:jboss:domain:weld:2.0"/>

          </profile>

       

       

          <interfaces>

              <interface name="management">

                  <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>

              </interface>

              <interface name="public">

                  <inet-address value="${jboss.bind.address:127.0.0.1}"/>

              </interface>

              <interface name="unsecure">

                  <inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/>

              </interface>

          </interfaces>

       

       

          <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">

              <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>

              <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9993}"/>

              <socket-binding name="ajp" port="${jboss.ajp.port:8009}"/>

              <socket-binding name="http" port="${jboss.http.port:8080}"/>

              <socket-binding name="https" port="${jboss.https.port:8443}"/>

              <socket-binding name="jgroups-mping" port="0" multicast-address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="45700"/>

              <socket-binding name="jgroups-tcp" port="7600"/>

              <socket-binding name="jgroups-tcp-fd" port="57600"/>

              <socket-binding name="jgroups-udp" port="55200" multicast-address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="45688"/>

              <socket-binding name="jgroups-udp-fd" port="54200"/>

              <socket-binding name="modcluster" port="0" multicast-address="224.0.1.105" multicast-port="23364"/>

              <socket-binding name="txn-recovery-environment" port="4712"/>

              <socket-binding name="txn-status-manager" port="4713"/>

            <outbound-socket-binding name="mail-smtp">

                  <remote-destination host="localhost" port="25"/>

              </outbound-socket-binding>

          </socket-binding-group>

       

      </server>

       

      I could not find what was causing the issue.






        • 1. Re: javax.mail API is not working with Wildfly9.0.0.Final Release
          Kiran Kumar Newbie

          Finally I found it is because of mail module in Wildfly9.0.0.Final. We can do this as temporary solution.And it works for me.

           

          Open standalone-ha.xml from <wildfly-9.0.0.Final-Home>\standalone\configuration

           

          Releace the following

           

          <subsystem xmlns="urn:jboss:domain:mail:2.0">

                                            <mail-session name="default" jndi-name="java:jboss/mail/Default">

                                                          <smtp-server outbound-socket-binding-ref="mail-smtp"/>

                                            </mail-session>

                           </subsystem>

           

          With

           

          <subsystem xmlns="urn:jboss:domain:mail:2.0">

                                          <mail-session name="default" jndi-name="java:jboss/mail/Default">

                                          </mail-session>

                       </subsystem>

           

           

          Now open “module.xml” from

          <wildfly-9.0.0.Final-Home>\modules\system\layers\base\javax\mail\api\main

           

          Replace the following line

           

          <resource-root path="javax.mail-1.5.3.jar"/>

           

          With

          <resource-root path="javax.mail-1.5.1.jar"/>

           

          And copy the “javax.mail-1.5.1.jar” form

          <wildfly-8.2.0.Final -Home>\modules\system\layers\base\javax\mail\api\main

           

          To

                          <wildfly-9.0.0.Final-Home>\modules\system\layers\base\javax\mail\api\main

           

          And remove “javax.mail-1.5.3.jar” from the

          <wildfly-9.0.0.Final-Home>\modules\system\layers\base\javax\mail\api\main

           

          And restart  the server. It works for me.

          • 2. Re: javax.mail API is not working with Wildfly9.0.0.Final Release
            jaikiran pai Master

            I don't understand what the problem you are running into (your first post doesn't explain much), but the workaround you posted in your recent reply isn't the right way to get past it, IMO.

            • 3. Re: javax.mail API is not working with Wildfly9.0.0.Final Release
              Jason Greene Master

              Hi Kiran,

               

              Could you try replacing that jar with:

               

              http://search.maven.org/remotecontent?filepath=javax/mail/javax.mail-api/1.5.4/javax.mail-api-1.5.4.jar

               

              And editing the module.xml to point to the new file.

               

              Let us know if that works for you.

               

              Thanks!

              • 4. Re: javax.mail API is not working with Wildfly9.0.0.Final Release
                Kiran Kumar Newbie

                Hi Jason,

                 

                 

                I tried it and  I got ".NoClassDefFoundError: com/sun/mail/util/MailLogger" in my log. see my log below. How would I add dependency in for that in my module.xml

                 

                 

                2015-07-29 10:05:03,784 DEBUG [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (default task-3) SmartPoolD: getConnection(null, WrappedConnectionRequestInfo@21498011[userName=admsh]) [0/30]

                2015-07-29 10:05:04,398 DEBUG [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (default task-3) SmartPoolD: returnConnection(95a27f3, false) [0/30]

                2015-07-29 10:05:04,398 DEBUG [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (default task-3) SmartPoolD: getConnection(null, WrappedConnectionRequestInfo@21498011[userName=admsh]) [0/30]

                2015-07-29 10:05:04,715 DEBUG [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (default task-3) SmartPoolD: returnConnection(95a27f3, false) [0/30]

                2015-07-29 10:05:04,744 DEBUG [class com.bodhtree.nexus.util.mail.Mail] (default task-3) I came

                2015-07-29 10:05:04,745 DEBUG [class com.bodhtree.nexus.util.mail.Mail] (default task-3) I set

                2015-07-29 10:05:04,749 DEBUG [org.springframework.web.servlet.DispatcherServlet] (default task-3) Could not complete request: org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.NoClassDefFoundError: com/sun/mail/util/MailLogger

                  at org.springframework.web.servlet.DispatcherServlet.triggerAfterCompletionWithError(DispatcherServlet.java:1260)

                  at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:939)

                  at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:851)

                  at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:953)

                  at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:855)

                  at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)

                  at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:829)

                  at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

                  at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:86)

                  at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:130)

                  at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)

                  at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)

                  at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60)

                  at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132)

                  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)

                  at com.bodhtree.nexus.filters.AccountVerificationFilter.doFilter(AccountVerificationFilter.java:414)

                  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

                  at org.springframework.security.web.authentication.switchuser.SwitchUserFilter.doFilter(SwitchUserFilter.java:181)

                  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

                  at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)

                  at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)

                  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

                  at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)

                  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

                  at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)

                  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

                  at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)

                  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

                  at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)

                  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

                  at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)

                  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

                  at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)

                  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

                  at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)

                  at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)

                  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

                  at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)

                  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

                  at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)

                  at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)

                  at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343)

                  at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260)

                  at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60)

                  at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132)

                  at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:85)

                  at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)

                  at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)

                  at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)

                  at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

                  at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)

                  at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)

                  at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

                  at io.undertow.security.handlers.AuthenticationConstraintHandler.handleRequest(AuthenticationConstraintHandler.java:51)

                  at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)

                  at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)

                  at io.undertow.servlet.handlers.security.ServletSecurityConstraintHandler.handleRequest(ServletSecurityConstraintHandler.java:56)

                  at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58)

                  at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:72)

                  at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)

                  at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)

                  at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

                  at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)

                  at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

                  at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

                  at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:282)

                  at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:261)

                  at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:80)

                  at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:172)

                  at io.undertow.server.Connectors.executeRootHandler(Connectors.java:199)

                  at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:774)

                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

                  at java.lang.Thread.run(Thread.java:745)

                Caused by: java.lang.NoClassDefFoundError: com/sun/mail/util/MailLogger

                  at javax.mail.Session.initLogger(Session.java:226)

                  at javax.mail.Session.<init>(Session.java:210)

                  at javax.mail.Session.getInstance(Session.java:247)

                  at com.bodhtree.nexus.util.mail.Mail.sendMail(Mail.java:236)

                  at com.bodhtree.nexus.controller.ForgotPasswordController.forgotPassword(ForgotPasswordController.java:153)

                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                  at java.lang.reflect.Method.invoke(Method.java:497)

                  at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)

                  at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:440)

                  at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:428)

                  at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:919)

                  ... 72 more

                Caused by: java.lang.ClassNotFoundException: com.sun.mail.util.MailLogger from [Module "javax.mail.api:main" from local module loader @707f7052 (finder: local module finder @11028347 (roots: C:\Work\wildfly-9.0.0.Final\modules,C:\Work\wildfly-9.0.0.Final\modules\system\layers\base))]

                  at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:205)

                  at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:455)

                  at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:404)

                  at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:385)

                  at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:130)

                  ... 85 more

                 

                 

                2015-07-29 10:05:04,752 DEBUG [org.springframework.security.web.context.HttpSessionSecurityContextRepository] (default task-3) SecurityContext is empty or contents are anonymous - context will not be stored in HttpSession.

                2015-07-29 10:05:04,753 DEBUG [org.springframework.security.web.context.SecurityContextPersistenceFilter] (default task-3) SecurityContextHolder now cleared, as request processing completed

                2015-07-29 10:05:04,754 ERROR [io.undertow.request] (default task-3) UT005023: Exception handling request to /forgotPassword.htm;jsessionid=wnyIndgLllDU7iKAwVRI1UHmrUu8Y8l_i_qxAnVb.kirankumar: org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.NoClassDefFoundError: com/sun/mail/util/MailLogger

                  at org.springframework.web.servlet.DispatcherServlet.triggerAfterCompletionWithError(DispatcherServlet.java:1260)

                  at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:939)

                  at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:851)

                  at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:953)

                  at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:855)

                  at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)

                  at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:829)

                  at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

                  at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:86)

                  at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:130)

                  at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)

                  at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)

                  at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60)

                  at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132)

                  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)

                  at com.bodhtree.nexus.filters.AccountVerificationFilter.doFilter(AccountVerificationFilter.java:414)

                  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

                  at org.springframework.security.web.authentication.switchuser.SwitchUserFilter.doFilter(SwitchUserFilter.java:181)

                  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

                  at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)

                  at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)

                  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

                  at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)

                  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

                  at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)

                  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

                  at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)

                  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

                  at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)

                  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

                  at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)

                  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

                  at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)

                  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

                  at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)

                  at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)

                  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

                  at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)

                  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

                  at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)

                  at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)

                  at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343)

                  at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260)

                  at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60)

                  at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132)

                  at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:85)

                  at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)

                  at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)

                  at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)

                  at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

                  at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)

                  at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)

                  at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

                  at io.undertow.security.handlers.AuthenticationConstraintHandler.handleRequest(AuthenticationConstraintHandler.java:51)

                  at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)

                  at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)

                  at io.undertow.servlet.handlers.security.ServletSecurityConstraintHandler.handleRequest(ServletSecurityConstraintHandler.java:56)

                  at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58)

                  at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:72)

                  at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)

                  at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)

                  at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

                  at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)

                  at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

                  at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

                  at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:282)

                  at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:261)

                  at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:80)

                  at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:172)

                  at io.undertow.server.Connectors.executeRootHandler(Connectors.java:199)

                  at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:774)

                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

                  at java.lang.Thread.run(Thread.java:745)

                Caused by: java.lang.NoClassDefFoundError: com/sun/mail/util/MailLogger

                  at javax.mail.Session.initLogger(Session.java:226)

                  at javax.mail.Session.<init>(Session.java:210)

                  at javax.mail.Session.getInstance(Session.java:247)

                  at com.bodhtree.nexus.util.mail.Mail.sendMail(Mail.java:236)

                  at com.bodhtree.nexus.controller.ForgotPasswordController.forgotPassword(ForgotPasswordController.java:153)

                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                  at java.lang.reflect.Method.invoke(Method.java:497)

                  at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)

                  at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:440)

                  at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:428)

                  at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:919)

                  ... 72 more

                Caused by: java.lang.ClassNotFoundException: com.sun.mail.util.MailLogger from [Module "javax.mail.api:main" from local module loader @707f7052 (finder: local module finder @11028347 (roots: C:\Work\wildfly-9.0.0.Final\modules,C:\Work\wildfly-9.0.0.Final\modules\system\layers\base))]

                  at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:205)

                  at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:455)

                  at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:404)

                  at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:385)

                  at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:130)

                  ... 85 more

                • 5. Re: javax.mail API is not working with Wildfly9.0.0.Final Release
                  Kiran Kumar Newbie

                  Hi Jai,

                   

                         This is some bug/problem with Wildfly-9.0.0.Final server mail module. Email is not going. If I copy the  mail module form Wildfly-8.2.0.Final to Wildfly-9.0.0.Final its works for me.I configured my server in HA mode. In Wildfly-8.2.0.Final I am getting Infinispan error. To over come this I have upgraded to Wildfly-9.0.0.Final. But in this we have mail issues.See the Jason's reply for this. He understood my problem.

                  • 6. Re: javax.mail API is not working with Wildfly9.0.0.Final Release
                    Tomaz Cerar Master

                    You have clash of mail api versions.

                     

                    javax.mail that comes with WildFly 9 is 1.5.3 version where you have 1.4 in your application.

                    you can try two things,

                    1) remove mail jar from your deployment

                    2) use 1.5.x in your deployment as well

                    • 7. Re: javax.mail API is not working with Wildfly9.0.0.Final Release
                      Kiran Kumar Newbie

                      Hi Tom,

                       

                        In my pom.xml I had the following.

                       

                      <!-- Mail -->

                        <dependency>

                        <groupId>javax.mail</groupId>

                        <artifactId>javax.mail-api</artifactId>

                        <version>1.5.3</version>

                        </dependency>

                       

                      And it does not works.

                      • 8. Re: javax.mail API is not working with Wildfly9.0.0.Final Release
                        Tomaz Cerar Master

                        well the log you pasted originally tells different story.

                        2015-07-28 15:30:40,629 FINE  [javax.activation] (default task-18) MailcapCommandMap: URL vfs:/C:/Work/wildfly-9.0.0.Final/bin/content/SmarthiresMaven.war/WEB-INF/lib/mail-1.4.jar/META-INF/mailcap

                         

                        otherwise i would recommend you to read https://java.net/projects/javamail/pages/Home

                         

                        especially the problem with logger CFNE, it is part of separate artifact