Java Mail on Jboss 7 or above

Learn how to work your Java mail on Jboss 7.

Most of the people have implemented Java mail for system updates or system notification using SMTP protocals and java mail was working fine on jboss 5 and  jboss6 then why the same code is not working with Jboss7 because the jboss 7 architecture completely changed for making the server bootup fast.

All you have to do is add the latest Java mail 1.4.4 jar in the modules and also you have add the javax.api into your java mail module.xml

Step by step procedure for you

1. Navigate jboss-as-web-7.0.0.Final\modules\javax\mail\api\main
2.Stop the server if it running
3.Remove the existing java mail jar and find the java mail 1.4.4 jar on the internet and put it in same directory where you deleted the existing version java mail jar
4.Now open the module.xml file in some note editor like notepad or notepad++
5.Add new module name javax.api like this  under the dependencies <module name="javax.api"/> so your xml file will be like the below one

<module xmlns="urn:jboss:module:1.0" name="javax.mail.api">
        <module name="javax.activation.api" export="true"/>
<module name="javax.api"/>

        <resource-root path="mail-1.4.4.jar"/>
        <!-- Insert resources here -->

6. Save the file.
7.Start the jboss Server and enjoy sending java mail using smtp servers.......


Popular posts from this blog

Five More Indian Languages - Google Translate