-
1. Re: Problem with JBoss AS 7.0 Final + Java Mail + java.lang.NoClassDefFoundError: javax/net/ssl/SSLPeerUnverifiedException
ctomc Oct 9, 2012 6:04 PM (in response to rajendra85)Hi,
is possible I would ugre you to upgrade to 7.1.x which has mail subsystem and has many issues in this area fixed.
if that is not option, please post your code that sends msg and contents of javax/mail/main/module.xml
--
tomaz
-
2. Re: Problem with JBoss AS 7.0 Final + Java Mail + java.lang.NoClassDefFoundError: javax/net/ssl/SSLPeerUnverifiedException
rajendra85 Oct 10, 2012 1:21 AM (in response to ctomc)Hi,
Here am pasting my code for sending mail that I used in my managed bean :
------------------------------------------------------------------------------------------------------------------------
String toWhom = "abcd@gmail.com"; String password = "abcdef";
String fromWhom = "web@gmail.com";
String host = "smtp.gmail.com"; String mailSubject = "Hi How are you ??";
String mailText = "Gmail Send Email Demo"; Properties properties = System.getProperties();
properties.setProperty("mail.smtp.host", host);
properties.setProperty("mail.smtp.port", "25");
properties.setProperty("mail.smtp.starttls.enable", "true");
properties.setProperty("mail.smtps.auth", "true");
Session session = Session.getDefaultInstance(properties);
session.setDebug(true);
Message message = new MimeMessage(session);
message.setSentDate(new Date());
message.setFrom(new InternetAddress(fromWhom));
message.setRecipient(Message.RecipientType.TO, new InternetAddress(toWhom));
message.setSubject(mailSubject);
message.setText(mailText);
Transport.send(message);
System.out.println("Done successfully");
and Here is my module.xml which is located at --- > boss-as-web-7.0.0.Final/modules/javax/mail/api/main
---------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="javax.mail.api">
<dependencies>
<module name="javax.activation.api" export="true"/>
</dependencies>
<resources>
<resource-root path="mail-1.4.4.jar"/>
</resources>
</module>
Am not getting Is there any jar files that i need to add as a dependency or any module to add as a dependency ??
-
3. Re: Problem with JBoss AS 7.0 Final + Java Mail + java.lang.NoClassDefFoundError: javax/net/ssl/SSLPeerUnverifiedException
ctomc Oct 10, 2012 11:54 AM (in response to rajendra85)Hi,
edit javax.mail.api module
to also have dependancy
<module name="javax.api"/>
it should fix your problem.
--
tomaz
-
4. Re: Problem with JBoss AS 7.0 Final + Java Mail + java.lang.NoClassDefFoundError: javax/net/ssl/SSLPeerUnverifiedException
rajendra85 Oct 11, 2012 1:08 AM (in response to ctomc)Hi Tomaz Cerar,
Thank you very much .... . Your suggestion solved my problem.. Once again thank u...
The correct solution is : In JBoss AS 7 - JBoss 7.0 Final / modules / javax / mail / api / main / module.xml ; We have to add
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="javax.mail.api">
<dependencies>
<module name="javax.activation.api" export="true"/>
<module name="javax.api"/> <!-- We have to add this line for recognizing the SSL Class -->
</dependencies>
<resources>
<resource-root path="mail-1.4.4.jar"/>
</resources>
</module>